Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^idA(.*) http://www.mydomain.com/anything.aspx?ida$1 [R=301,L]
RewriteRule ^idb(.*) http://www.mydomain.com/anything.aspx?ida$1idB$2 [R=301,L]
The [Next] flag could be used, for example, if you wished to replace a certain string or letter repeatedly in a request. The example shown here will replace A with B everywhere in a request, and will continue doing so until there are no more As to be replaced.
RewriteRule (.*)A(.*) $1B$2 [N]
You can think of this as a while loop: While this pattern still matches (i.e., while the URI still contains an A), perform this substitution (i.e., replace the A with a B).
RewriteCond %{QUERY_STRING} [D,P]
RewriteCond %{QUERY_STRING} ^idDept(.+)
RewriteRule (.+) $1?iddept%1 [R=301] RewriteCond %{QUERY_STRING} ^(.+)idProduct(.+)
RewriteRule (.+) $1?%1idproduct%2 [R=301,L] You will need multiple rules, one for each possible incorrect request format, but only one rule will run for any request that actually arrives.
^idDept(.+)idProduct(.+) www.mydomain.com/anything.aspx?iddept=123456&idproduct=1234 it gives me the adress: www.mydomain.com/home/mydomain/public_html/anything.aspx?iddept=123456&idproduct=1234 RewriteEngine On
RewriteMap lc int:tolower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lc:$1} [R=301,L] Options +FollowSymLinks
RewriteEngine On
RewriteMap lc int:tolower
RewriteCond %{QUERY_STRING} [A-Z]
RewriteRule (.*) ${lc:$1} [R=301,L]