tags:

views:

23

answers:

1

I'm using a PHP framework which redirect all URL to the index.php file using the following rule:

RewriteRule ^(.*)$ /index.php/$1 [L]

However, I want to be able to use index.html IF ANY ONLY IF users hit the home page. For instance, if users hit http:// website.com it will render the index.html file. Any other URL will use index.php. Could someone help?

ThankS

A: 
^/(.+)$

Matches everything but the root.

However, either way this rewrite strategy is questionable. Sending absolutely everything to PHP — including robots.txt, favicon.ico, crossdomain.xml, other random things a bot might speculatively request, and all the automated break-in attempts on odd paths that don't exist — is likely to hit performance hard.

(It's also a potential problem if the script doesn't reply 404 properly for non-existant paths: someone could use file-based domain authentication to take over Google Webmaster Tools for your account.)

I'd try to put some limitations on what kind of paths are allowed to match.

bobince
Not to mention, what about images? css and javascript files?
Rob