Jump to content


Photo

Excluding A File


  • Please log in to reply
2 replies to this topic

#1 broomsy

broomsy
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 26 October 2006 - 10:07 AM

My .htaccess file currently reads like this:

RewriteEngine on 
RewriteRule ^(.*)\.html index.php?$1

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 :)

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 26 October 2006 - 05:56 PM

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?

#3 broomsy

broomsy
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 October 2006 - 01:11 PM

I am now using:

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

Is this an improvement?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users