1

For some reason this rule is causing havoc in all subsequent rules (none of theme work). What does it mean exactly?

RewriteRule . /index.php [L]

2
  • It doesn't make sense, at least to me as I'm a little rusty with rewrite rules... I do know the [L] just tells it to stop processing after running that rule. If I had to take a guess though it's almost like someone was attempting to rewrite all requests to the base directory of host to index.php... Aug 2, 2011 at 21:50
  • This line on it's own make little sense (most likely you will have 500 server error if it would be only one rewrite line). There has to be one or more RewriteCond lines before this one.
    – LazyOne
    Aug 2, 2011 at 22:19

2 Answers 2

1

That rule is apparently supposed to hide the "index.php" part of a visible url. When your working url is this http://www.somesite.com/index.php, this rule will make the browser display http://www.somesite.com/.

Well, it's probably acting the other way around. When the server receives a request http://www.somesite.com/, it'll serve up http://www.somesite.com/index.php, just without showing that last bit.

There are other ways to do this that may be more effective and less likely to cause problems such as you're experiencing. I did a google search for "mod rewrite RewriteRule . /index.php" to get this info, and most of the pages seem to have some useful suggestions regarding better ways to do this.

0

I believe it redirects it to root. That way when you go to www.example.com it doesn't show www.example.com/index.php. Helpful for SEO purposes.

Is this a Wordpress setup?

This is a good article over on stackoverflow that explains this.

Not the answer you're looking for? Browse other questions tagged .