...

View Full Version : please explain..



mjs
04-25-2010, 09:32 AM
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

gusblake
04-25-2010, 10:26 AM
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.

Samhain13
04-29-2010, 12:51 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum