eberswine
eberswine

Reputation: 1224

htaccess maintenance page with a url variable exception

I searched for a while, but couldn't find the exact answer. So here it goes.

I have a membership site that has a PayPal IPN listener. This needs to be active and accesable at all times!

I am doing a maintenance update today that might take a few hours. How do I add an execption for a URL like this in my .htaccess page:

http://mycoolwebsite.com/?listener=IPN

Here is my .htaccess page so far:

# activate rewrite engine
RewriteEngine On

# ip address so i can access
RewriteCond %{REMOTE_ADDR} !=xx.xx.xx.xx

RewriteCond %{REQUEST_URI} !^/img/.*$
RewriteCond %{REQUEST_URI} !^/maintenance\.php$

Thanks NINJAS!

Upvotes: 1

Views: 119

Answers (1)

anubhava
anubhava

Reputation: 785531

You can have your rules like this:

# activate rewrite engine
RewriteEngine On

# skip /?listener=IPN from rewrites
RewriteCond %{QUERY_STRING} ^listener=IPN$
RewriteRule ^ - [L]

# rest of your rules follow

PS: I notice that you just have 3 RewriteCond lines without any RewriteRule line. Which is not really doing anything for you.

Upvotes: 1

Related Questions