Need help to review .htaccess to redirect users

Hi, 

Whilst the site is being built, I want the visitors (other than my own IP) to access another server directory instead, so to the original .htaccess I added:

RewriteCond %{REMOTE_ADDR} !^(18\.13\.112\.222|18\.4\.144\.106)

RewriteCond %{REQUEST_URI} !^/inamoment/ [NC]

RewriteRule ^(.*)$ http://mysite.com/inamoment/$1 [R=302,L]

This was added after RewriteEngine on, (of course the IPs shown here are fake).

When I do this and upload, then I get a 500 server error.

-- The strange is that this is a fresh installation, but on the old one this was working like a charm --

 

Do you mind to have a look on the attached file and tell me if something is wrong?

.htaccess.bak · 7.5K · 182 downloads
Quote · 6 Apr 2014

RewriteCond %{REMOTE_HOST} !^123\.45\.67\.89
RewriteCond %{REQUEST_URI} !/alternate_page\.html$
RewriteRule \(.*)$ /alternate_page.html [R=302,L]

 

First line - Exclude your IP address

Second line - Exclude the page that you are sending your users to

Third line - send every request for any page to alternate page - this line may not be 100% correct.

caredesign.net
Quote · 6 Apr 2014

Nope, doesn`t work

WT***, I haven`t modified nothing on the server, just deleted the old boonex install, re installed and rewrote the .htaccess, and even with yours I get:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@thesite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

I even copied the same php.ini from the old one, and parameters are all the same

One more evening sleeping on the keyboard

 

Quote · 6 Apr 2014

Let's start over with the original Dolphin .htaccess file in place.  Then make one change and see what happens, if good, then add the next, as so forth.

Geeks, making the world a better place
Quote · 7 Apr 2014

Working.

I wrote with one IP only, worked:

and then added the second, and voila! Strange server

Quote · 7 Apr 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.