Redirect in htaccess based on IP unexpected results

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Redirect in htaccess based on IP unexpected results

Post by matthijs »

I've got this htaccess on a site:

Code: Select all

 
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^12\.123\.123\.123
RewriteRule ^(.*)$ http://temp.wordpress.com [R=302,L]
which redirects everyone but me to the other http://temp.wordpress.com site.

However, now I'm editing pages in Wordpress, installed on that site, and I get a 403 when editing a page. I think it has something to do with the request headers, which look like

Code: Select all

/wp-admin/page.php?action=edit&post=9&_wp_original_http_referer=http%3A%2F%2Fwww.thewebsite.nl%2Fwp-admin%2Fedit-pages.php&message=1
If I get rid of the wp_original_http_referer=http%3A%2F%2Fwww.thewebsite.nl I do get access.

Does someone understand what could be happening here?
Post Reply