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 2 of 2
  1. #1
    Regular Coder student101's Avatar
    Join Date
    Nov 2007
    Posts
    634
    Thanks
    80
    Thanked 15 Times in 15 Posts

    Question htaccess and folders? "/" or "\"

    Code:
    # block comment spam by denying access to no-referrer requests
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} POST
    RewriteCond %{REQUEST_URI} .page\.php*
    RewriteCond %{HTTP_REFERER} !.*example.com.* [OR]
    RewriteCond %{HTTP_USER_AGENT} ^$
    RewriteRule ^(.*)$ ^http://the-site-where-you-want-to-send-spammers.com/$ [R=301,L]
    I am new to .htaccess and have to ask…
    Q1: Can I use this for any page that is posting data?
    Q2: If Q1 is YES, my page is one folder deep, ie:comments/page.php
    Do I do this:
    Code:
    RewriteCond %{REQUEST_URI} .comments/page.php\.php*
    Or this:
    Code:
    RewriteCond %{REQUEST_URI} .comments\page.php\.php*
    Or this:
    Code:
    RewriteCond %{REQUEST_URI} .http://www/example.com/comments/page.php\.php*
    Or this:
    Code:
    RewriteCond %{REQUEST_URI} ./var/htdocs/web/comments/page.php\.php*
    Edit: I have searched and found nothing that answers my question!
    Any help would be great.
    Cheers
    Last edited by student101; 03-15-2009 at 08:50 AM.
    Thanks for your support!
    Update MySQL with checkboxes | Tell A Friend | Delete MySQL with checkboxes

    Give thanks & resolve when done :thumbsup:

  • #2
    Regular Coder student101's Avatar
    Join Date
    Nov 2007
    Posts
    634
    Thanks
    80
    Thanked 15 Times in 15 Posts
    I really need help understanding what this does and if I am correct at all???
    Code:
     
    RewriteEngine On  # The RewriteEngine directive enables or disables the runtime rewriting engine.
    RewriteCond %{REQUEST_METHOD} POST # The RewriteCond directive defines a rule condition.
    RewriteCond %{REQUEST_URI} .folder/pagename\.php* # Contains the value of the uri field of request? This part I don't get at all. is "/" or "\" or even "./" or ".\" (without quotes)
    RewriteCond %{HTTP_REFERER} !.*example.com.* [OR] # Check the REFERER
    RewriteCond %{HTTP_USER_AGENT} ^$ # Rewrite the Homepage, according to the User-Agent
    RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L] # Send the user back to their page they came from? This part I don't get either.
    Cheers
    Last edited by student101; 03-16-2009 at 09:26 AM. Reason: More info...
    Thanks for your support!
    Update MySQL with checkboxes | Tell A Friend | Delete MySQL with checkboxes

    Give thanks & resolve when done :thumbsup:


  •  

    Posting Permissions

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