homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

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

 5:20 pm on Aug 1, 2010 (gmt 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)

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)

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...


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved