Jump to content

Recommended Posts

Posted

I have the following (excerpt) in my htaccess file to allow access to certain sites to view graphics files else land at the index page:

 

>RewriteEngine on

RewriteCond %{HTTP_REFERER} !^http://allowed-site1.com/.*$	  [NC]
RewriteCond %{HTTP_REFERER} !^http://allowed-site1.com$	  [NC]
RewriteCond %{HTTP_REFERER} !^http://allowed-site2.com/.*$	 [NC]
RewriteCond %{HTTP_REFERER} !^http://allowed-site2.com$	  [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ /index.html [R,NC]

 

This works fine but is there a way that I can "approve" my own self by allowing my IP? Sometimes I need to view things outside the page environment.

 

No biggie but it would make life a little easier.

 

As always, I appreciate your time and input,

Posted

Try adding the following line into your list of conditions;

>RewriteCond %{REMOTE_ADDR} !^192\.192\.192\.192$

and replace the 192.192.192.192 with your IP address

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...