Jump to content

Archived

This topic is now archived and is closed to further replies.

broomsy

Excluding A File

Recommended Posts

My .htaccess file currently reads like this:

[code]RewriteEngine on
RewriteRule ^(.*)\.html index.php?$1[/code]

So basically my index.php?blah would turn into blah.html.

My question is if I actually put a file up like test.html it actually goes to my index.html. How can I make real html files appear in the browser? Can I just exclude the file? I only need to validate Yahoo Site Explorer.

Also as your all so helpful can anyone explain my rewrite rule. I managed to put it together but didnt really understand it :)

Share this post


Link to post
Share on other sites
Its to do with your rewriteRule. Its too "hungry"

So what ever you put after your domain name, say you do http://mysite.com/somefile.somecrap mod_rewrite will kick in and go to index.php?somefile.somecrap

You need to use a better regular expression.

What URL parameters does index.php take?

Share this post


Link to post
Share on other sites
I am now using:

[code]RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\.html index.php?$1[/code]

Is this an improvement?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.