Forum Moderators: phranque
That RegEx pattern will never match any request with a query string as there is nowhere in the pattern to match a literal question mark followed by the characters in the appended query string.
[edited by: g1smd at 9:13 pm (utc) on Sep 18, 2011]
<IfModule mod_rewrite.c>
RewriteEngine on
## Strip Mobile Pack query strings ##
RewriteCond %{QUERY_STRING} (.+)wpmp_.*$ [NC, OR]
RewriteCond %{QUERY_STRING} (.+)mobile_.*$ [NC]
RewriteRule ^(.*)$ $1?%1 [R=301,L]
</IfModule>
RewriteEngine on
## Strip Mobile Pack query strings ##
RewriteCond %{QUERY_STRING} ^(.+)(mobile|wpmp)_. [NC]
RewriteRule (.*) http://www.example.com/$1?%1 [R=301,L] (this|that) format to condense two lines into one. It is recommended. RewriteCond %{query_string} ^wpmp_.*$ [NC,OR]
RewriteCond %{query_string} ^mobile_.*$ [NC]
RewriteCond %{query_string} ^(wpmp|mobile)_ [NC] I know a ? removes the string but does the ? in '/$1?%1' not refer specifically to the trailing forward slash in '.com/' only? If I'm expressing myself clearly?
RewriteCond %{QUERY_STRING} (.+)wpmp_.*$ [NC, OR]
RewriteCond %{QUERY_STRING} (.+)mobile_.*$ [NC]
RewriteRule ^(.*)$ $1?%1 [R=301,L] RewriteCond %{QUERY_STRING} ^(.+)(mobile|wpmp)_. [NC]
RewriteRule (.*) http://www.example.com/$1?%1 [R=301,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^?]*)\?
RewriteCond %{QUERY_STRING} ^(wpmp|mobile)_ [NC]
RewriteRule . http://www.example.com/%1? [R=301,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.
RewriteCond %{THE_REQUEST} \?
RewriteCond %{QUERY_STRING} ^(wpmp|mobile)_ [NC]
RewriteRule (.*) http://www.example.com/$1? [R=301,L]