homepage Welcome to WebmasterWorld Guest from 54.227.25.58
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

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?!?
brand404




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

I added the following to my htaccess file

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


It is able to block ip address: 1.2.3.4 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!

 

nigelt74




msg:4180315
 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} 1.2.3.4
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

jdMorgan




msg:4180559
 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...

Jim

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