Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts

    HELP! 403 error after modifying .htaccess rewrite rules killing my site..

    Hi,
    The following issue is driving me mad. Any one around to fix my issues and get me out of this stress? Will be really grateful.

    I developed this application to check social sharing counts for any website.
    http://shareyt.com/SocialCounter.php

    I was cross checking websites performance and seo status when I found my site is prone to libwww-perl attacks. I tried suggested steps to block libwww-perl useragents and accordingly I added following codes to my .htaccess file

    Code:
    RewriteCond %{HTTP_USER_AGENT} libwww [NC,OR]
    RewriteCond %{QUERY_STRING} ^(.*)=http [NC]
    RewriteRule ^(.*)$ – [F,L]
    Now after that when I try to run the application on my site and submit any url consisting "http://" in front of it, I get a 403 access denied error.
    However, the here (http://shareyt.com/SocialCounter.php) application still works when the "http://" is not in query url.

    For example: if you try this link you will get the counts :
    http://shareyt.com/SocialCounter.php...talakes.net%2F
    But the following link will give 403 error.
    http://shareyt.com/SocialCounter.php...talakes.net%2F

    I have removed the mod rewrite codes and restored old version of .htaccess file. But its in vein.
    I have also cleared browsers cache. Nothing works.

    Please help.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    I'm not sure I follow the problem here.
    http:// is according to this required to be removed from the querystring. Whenever it is present it *should* throw a 403.
    Looks to me that the .htaccess hasn't been modified or is cached server side (which it shouldn't be).
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • Users who have thanked Fou-Lu for this post:

    sanomani (04-17-2013)

  • #3
    New Coder
    Join Date
    Jun 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Yes, exactly, what i was trying to say.

    When the query string contains "http://" the url shows 403 error.
    But if the http:// portion is excluded the page works just fine.

    Can it be caching on server side causing this problem?
    If so how to get rid of this?

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Shouldn't be, not if you put it in a .htaccess file.
    You can try restarting the httpd daemon or the machine itself. You can only do that of course if you are using a dedicated machine.
    My suspicion is still that the .htaccess you have is the old one.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •