The url is like
http://www.example.com/?p=3733&preview=true
and I want to add ?ModPagespeed=noscript
so it becomes http://www.example.com/?p=3733&preview=true?ModPagespeed=off
p= is dynamic btw
Any ideas?
The url is like
http://www.example.com/?p=3733&preview=true
and I want to add ?ModPagespeed=noscript
so it becomes http://www.example.com/?p=3733&preview=true?ModPagespeed=off
p= is dynamic btw
Any ideas?
put this code in your DOCUMENT_ROOT/.htaccess
file:
RewriteEngine On
RewriteCond %{QUERY_STRING} (^|&)p=[^&]+
RewriteCond %{QUERY_STRING} (^|&)preview=true(&|$)
RewriteCond %{QUERY_STRING} !(^|&)ModPagespeed=off(&|$)
RewriteRule ^$ %{REQUEST_URI}?ModPagespeed=off [L,QSA,R]
UPDATE: If you want final URL with 2 ?
in it, use this rule:
RewriteCond %{QUERY_STRING} (^|&)p=[^&]+
RewriteCond %{QUERY_STRING} (^|&)preview=true(&|$)
RewriteCond %{QUERY_STRING} !(^|&)ModPagespeed=off(&|$)
RewriteRule ^$ %{REQUEST_URI}?%{QUERY_STRING}?ModPagespeed=off [L,NE,R]