Page is a not externally linkable
lucy24 - 1:51 am on Apr 14, 2012 (gmt 0)
As far as I can see a request for www.example.com/index.php/nonsense/rubbish/non-existant.php serves the content found at www.example.com/index.php
Uh-oh. That sounds as if somewhere along the line, everything after "index.php" is getting deleted. You said htaccess, which I assume means you're on shared hosting and there's stuff going on in the config file that you have no control over. But it can't hurt to have a look at your host's control panel-- by whatever name-- and make sure you never accidentally set a preference that tells the server to do the name-chopping thing.
But the rule is written as a Redirect, which means you're not simply serving content; the browser's address bar is changing. Is that what happens when you enter a garbage URL?
To test whether the rule is working at all, add a Condition that limits it to yourself-- for example, by saying "only from such-and-such IP". And change the target from
http://www.example.com/$1
to something like
http://www.example.com/foobar.html
You will of course get your 404 page-- but your browser's address bar will say where it thinks you are. If it says "foobar.html" the rule is working. If it just gives your domain name, with or without "index.whatever", then something else is intercepting the request before it ever reaches the RewriteRule in your .htaccess.