For example:
google.com/en/game/game1.html
should be
google.com/index.php?p1=en&p2=game&p3=game1.html
how can i split URL and send index.php the part of "/" ?
相关问题
- Backbone.js PushState routes .htaccess only workin
- Stop .htaccess redirect with query string
- .htaccess rule, redirecting old unexistent address
- UrlEncodeUnicode and browser navigation errors
- Improve converting string to readable urls
相关文章
- C# HttpClient.SendAsync always returns 404 but URL
- Prevent $anchorScroll from modifying the url
- How does a browser handle cookie with no path and
- Base64URL decoding via JavaScript?
- Multiple htaccess rewrite rule
- AWS ALB redirect to https
- Splitting an array into the variables in php
- Pass multi-word arguments to a bash function
You can only achieve this if the query parameters are of a fixed length. Otherwise there is an other way but requires parsing of the path in the application.
Fixed length implementation
The following rule matches all three URL parts then rewrites them as named query arguments to index.php.
This rewrites:
To:
Unknown length implementation
This rewrites:
To:
Then you can parse the path in the application.
Edit:) To make it so the rewrite rule only matches if the first level of the URL consists of two characters do:
You can also do it for the unknown length implementation so: