Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

htaccess - Doesnt block user from RSS viewing.WHY?!?

5:20 pm on Aug 1, 2010 (gmt 0)

New User

5+ Year Member

joined:Feb 11, 2010
votes: 0

I added the following to my htaccess file

RewriteCond %{REMOTE_ADDR}
RewriteRule ^.*$ http://www.yahoo.com/ [L,R=302]

It is able to block ip address: and redirect him to yahoo's main page but it does not prevent this user from getting access to my rss feed which is located at: www.mysite.com/feed/

Interestingly, the "feed/" resource does not exist in my directory but seems to be a virtual one defined internally by wordpress. but i would figure any incoming request would first have to go through htaccess before ever moving forward.

My guess is that when the url points to an existing file the htaccess is able to block and redirect the user but if it is a virtual directory (one that doesnt exist) made by WordPress it seems to let it through.

How do i fix this to redirect this user FOR EVERY CASE!
9:07 pm on Aug 1, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 7, 2005
votes: 0

Something like this? put it in the wordpress directory

try carefuklly as I am woeful at this stuff

RewriteCond %{REMOTE_ADDR}
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ h t t p:// yahoo.com [R=301,NC,L]

There also feed redirection mods/plugins for wordpress but I am unsure if they will allow you to drill down to one user
1:11 pm on Aug 2, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
votes: 0

Be sure that your access-control code is placed before the rewriterule(s) provided by WP in your main .htaccess file. Rule order is important...