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 3 of 3
  1. #1
    mjs
    mjs is offline
    New Coder
    Join Date
    Jan 2010
    Posts
    97
    Thanks
    17
    Thanked 0 Times in 0 Posts

    please explain..

    Hi all,

    can anyone please explain what the mean of:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/index.php
    RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
    RewriteRule (.*) index.php
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

    RewriteCond %{REQUEST_URI} !^hal/
    RewriteRule ^(.*)$ hal/$1 [L]

    Thank you in advance

  • #2
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts
    http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

    It basically checks the URL against a pattern, and does something to it if it matches.

    I think the ones with .* in them block access to Apache config files like .htaccess and .htpasswd.

  • #3
    Regular Coder Samhain13's Avatar
    Join Date
    Aug 2008
    Location
    Pilipinas
    Posts
    169
    Thanks
    4
    Thanked 18 Times in 18 Posts
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/index.php
    RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
    1. If the requested file DOES NOT exist.
    2. If the requested directory DOES NOT exist.
    3. If the requested file is index.php in the document root.
    4. If the requested file has the following extensions: php, html, htm, feed, pdf, or raw; this condition is case-insensitive.

    RewriteRule (.*) index.php
    If 1, 2, 3, and/or 4 is TRUE, redirect to index.php.

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
    Don't know what this means but if the server follows this rule, then it should be the last thing it follows. What's next will be ignored.

    RewriteCond %{REQUEST_URI} !^hal/
    RewriteRule ^(.*)$ hal/$1 [L]
    Basically, redirects all requests outside of the "hal" directory to the "hal" directory.
    I am a Man of Truth. I am a Free Human Person. I am a Peacemaker.
    ** Independent Multimedia Artist in Pasig **


  •  

    Posting Permissions

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