Forum Moderators: phranque
I need to change the following URL
/servlet/Satellite?pagename=OUKPersonal&c=OUKService&cid=1096023562415&t=Service&tab=3
to
/servlet/Satellite?pagename=OUKPersonal&c=OUKService&cid=1096023562415&t=Service&tab=3&mid=1137070318872
using httpd.conf file
If you notice mid=1137070318872 parameter needs to get appened in the end. I used the following rewrite rule, but does not work.
RewriteCond %{QUERY_STRING} ^pagename=OUKPersonal [nc]
RewriteCond %{QUERY_STRING} t=Service [nc]
RewriteCond %{QUERY_STRING} cid=1096023562415 [nc]
RewriteCond %{QUERY_STRING} c=OUKService [nc]
RewriteCond %{QUERY_STRING} tab=3 [nc]
RewriteRule ^/servlet/Satellite(.*)$ /$1&mid=1137070318872 [QSA,R]
The redirected URL in the logs is
"GET /&mid=1137070318872?pagename=OUKPersonal&c=OUKService&cid=1096023562415&t=Service&tab=3 HTTP/1.1" 404
The mid parameter seems to get append to the start of URL. Can anyone help?
Welcome to WebmasterWorld!
Your syntax is a bit off. You must use "?" to tell mod_rewrite that the string following the substitution URL is a queery string:
Internal (silent) rewrite:
RewriteRule ^/servlet/Satellite/?$ /servlet/Satellite/?mid=1137070318872 [QSA,L]
External redirect (updates browser address bar, changes search engine listing):
RewriteRule ^/servlet/Satellite/?$ http://www.example.com/servlet/Satellite/?mid=1137070318872 [QSA,R=301,L]