Answer the question
In order to leave comments, you need to log in
How to get an arbitrary number of GET parameters via MOD_REWRITE?
There are links like:
www.site.ru/city123
www.site.ru/city123/type54/project1198
www.site.ru/project1198/type54/
In other words, the number of parameters may be arbitrary, or may not be at all.
Here is a code that helps to isolate only the first pair of letters + numbers
RewriteRule ^([a-z]*)([0-9]*)/*$ index.php?$1=$2%{QUERY_STRING}
$_GET[city] => 123
Answer the question
In order to leave comments, you need to log in
# 301 --- http://www.test.com/faq.html?faq=13&layout=bob => http://www.test2.com/faqs.html
RewriteCond %{HTTP_HOST} ^www\.test\.com$
RewriteCond %{QUERY_STRING} (^|&)faq=13($|&)
RewriteCond %{QUERY_STRING} (^|&)layout=bob($|&)
RewriteRule ^faq\.html$ http://www.test2.com/faqs.html? [L,R=301]
# 301 --- text/faq.html?faq=20 => helpdesk/kb.php
RewriteCond %{QUERY_STRING} (^|&)faq=20($|&)
RewriteRule ^text/faq\.html$ /helpdesk/kb.php? [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question