简体   繁体   中英

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM