someone
someone

Reputation: 13

Mod_rewrite: Direct everything to one PHP file

I have this rule:

<IfModule mod_rewrite.c>
 RewriteEngine On

 RewriteCond %{REQUEST_FILENAME} !index.php

 RewriteRule ^(.*)$ index.php?req=$1
</IfModule>

Everything works fine if I request non-existing directories like myhost/view/blah, but when i enter some existing directory in the url like myhost/module I get redirected to module/?req=module instead of staying at module/

What am I doing wrong? I would need something that redirects everything to index.php (except index.php, of course).

Upvotes: 1

Views: 458

Answers (1)

Gumbo
Gumbo

Reputation: 655239

DirectorySlash could cause this behavior. Try to disable it.

Upvotes: 1

Related Questions