1

I tried to redirect all the pages to one page. I got the solution from the following question in Stack overflow but I'm getting Too many redirects error. Here is my code:

Options -MultiViews +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/closing-down$ 
RewriteCond %{REMOTE_HOST} !^my\.ip\.11\.11
RewriteRule $ /closing-down [R=302,L]
Sarath Kumar
  • 1,136
  • 1
  • 18
  • 41

1 Answers1

0

Change your rule to this:

Options -MultiViews +FollowSymLinks
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{THE_REQUEST} !\s/closing-down[\s?] [NC]
RewriteCond %{REMOTE_HOST} !^my\.ip\.11\.11
RewriteRule ^ /closing-down [R=302,L]

And test this in new browser to avoid old cache.

Using THE_REQUEST instead of REQUEST_URI as REQUEST_URI may change to /index.php after WP default rule whereas THE_REQUEST remains unchanged for a web request.

anubhava
  • 761,203
  • 64
  • 569
  • 643