Forum Moderators: phranque

Message Too Old, No Replies

.htaccess redirect to ignore a specific URL

         

criscokid

12:45 pm on Mar 5, 2011 (gmt 0)

10+ Year Member



I currently have the following entry in my .htaccess 'redirect everything except for /wp-admin/* & /wp-login.php':

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/wp-admin/*
RewriteCond %{REQUEST_URI} !^/wp-login.php
RewriteRule .* [newdomain.com...] [R=301,L]

I would like to be able to exclude the following URL as well but can't figure out what to add to .htaccess:
/?wpmlmethod=newsletter&id=5&subscriber_id=1&authkey=53fde96fcc4b4ce72d7739202324cd49

along with variations of it:
/?wpmlmethod=newsletter&id=X&subscriber_id=X&authkey=X

I'd really appreciate some assistance with this.

g1smd

1:10 pm on Mar 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Use example.com in the forum to stop URL auto-linking.

You have two negative match RewriteConds looking at the path part of the URL.

You'll need another preceding negative match RewriteCond looking at the QUERY_STRING value.

criscokid

1:45 pm on Mar 5, 2011 (gmt 0)

10+ Year Member



I know I need to add another line just before 'RewriteRule'; I just don't know what I need to enter on that line. Can you please specify exactly what I should enter here.

g1smd

1:52 pm on Mar 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You already have a RewriteCond (RewriteCond) with a negative match (!) looking at the path (REQUEST_URI) of /wp-login.php.

Now you need another preceding negative match RewriteCond looking at the QUERY_STRING value of wpmlmethod=newsletter&id=X&subscriber_id=X&authkey=X where the number X can be fulfilled with [0-9]+ here.