I would like to know how can I rewrite www.site.com?lang=lv&type=1&mode=2
into www.site.com/lv/1/2
using Apache mod_rewrite options.
相关问题
- Stop .htaccess redirect with query string
- .htaccess rule, redirecting old unexistent address
- UrlEncodeUnicode and browser navigation errors
- How to deploy a web application Aurelia in an Apac
- Apache Directory Studio not opening
相关文章
- Apache+Tomcat+JK实现的集群,如果Apache挂了,是不是整个服务就挂了?
- How reliable is HTTP_HOST?
- Making a two way SSL authentication between apache
- UnicodeEncodeError when saving ImageField containi
- mod_rewrite only on GET
- C# HttpClient.SendAsync always returns 404 but URL
- Prevent $anchorScroll from modifying the url
- jquery how to get the status message returned by a
Basic rewrite:
Edit: Changed rewrite flags to force a permanent redirect
Assuming that you actually want to rewrite
/lv/1/2
to?lang=lv&type=1&mode=2
(I see no reason to do the opposite) and that no other rewrites are active, this should do the trick:Also; you'd be better off replacing those magic numbers with more useful information if you want to include them in your URI.
Edit: If it really is the opposite you'd like to do, see the answer by Matt S.
You need to handle the URI path and query separately. If the parameters appear in that very same order, you can do this:
Otherwise you will need to put them in the right order before using this rule or take each parameter at a time.