-5

I'm trying to ensure that everyone is redirected to my /splash folder except for my own IP ... but the only scripts I can find are ones that deal with a single file. I need to ignore the files within the /splash folder because I need to be able to show a logo on the splash page...

Here's my code:

RewriteCond %{REMOTE_ADDR} !=12.345.67.89
RewriteRule !^(splash$|images/|style/) splash [L]

What should be modified or included to Redirect everyone except my ip to a file?

anubhava
  • 761,203
  • 64
  • 569
  • 643
dcolumbus
  • 9,596
  • 26
  • 100
  • 165

1 Answers1

1

Don't know why so many downvotes on this question.

Add a R flag for redirection and some correction in your regex:

RewriteEngine On

RewriteCond %{REMOTE_ADDR} !^12\.345\.67\.89$
RewriteRule !^(splash|images|style)(/|$) /splash [L,NC,R]

This should be first rule in your DocumentRoot/.htaccess.

anubhava
  • 761,203
  • 64
  • 569
  • 643
  • I dont either... just an honest question. So I've done this... but it just won't work for my IP. I just keep getting directed to the splash folder. – dcolumbus Jan 30 '14 at 11:31
  • This is fairly simple rule and I have tested it also. If your IP is correct in this rule then it wont redirect to `/splash` page. Check your external IP and make sure you have it here correctly. – anubhava Jan 30 '14 at 13:17