views:

18

answers:

1

Can anybody tell me what this does?

RewriteRule .* .main.php [QSA,L]

From what I understand it will rewrite ANYTHING to main.php correct? But not so sure what the QSA,L does.

This is the whole .htaccess file, when I hit the main directory I get a 400 Bad Request error. Edit: Bad request went away when I added an ending slash in the browser to the root directory of this script.

RewriteEngine On


# Transfering to the main tranfer file

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !\.css$
RewriteCond %{REQUEST_FILENAME} !\.js$

RewriteRule .* .main.php [QSA,L]

# nobody is allowed to access the access the  INI file

<FilesMatch "\.inc.php$">
    Order allow,deny
    Deny from all
</FilesMatch>

Thanks very much!

A: 

QSA = Query String Append: append the existing query string to the re-written rule

L = Last Rule: last rule of the set, don't process any following RewriteRule

Check out the documentation for more.

Do you have a file that is named .main.php? The dot prefix worries me. Your rules read that unless the request is an exists, symbolic link, or it has a CSS or JS extension it goes to .main.php

Jason McCreary
Thanks. Yeah.... there is a file called .main.php, actually there is a lot of files in this script with a dot before their name... pretty weird actually. Though those dots are confusing me a bit too, don't they mean "any single character" in regex form?
Brett
FTR.. Bad request went away when I added an ending slash in the browser to the root directory of this script.
Brett
It should work with or without the slash. Comment with the URL, is this subdirectory? You are right as far as a dot matching any character. But the dot in this case is on the right side which is a literal string. The dot is probably prefixed as an additional security measure.
Jason McCreary
Ok thanks. URL isL http://www.condorstudios.com/work/jbeweb/hollywood-xposed/beta/
Brett