Reputation: 71
I am trying to setup a way to rewrite all php files in a subfolder to index.php
What I have been trying until now:
RewriteEngine on
RewriteBase /simple
RewriteRule ^(.+)/$ index.php
It does not work 100%, now it takes the CSS, IMG and all other files too, which it should not, only the PHP files.
Hope some can help. Thank you.
Upvotes: 1
Views: 543
Reputation: 785286
You can use:
DirectoryIndex index.php
RewriteEngine on
RewriteBase /simple/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
Or this rule:
RewriteRule !\.(js|ico|gif|jpe?g|png|css|html|swf|flv|xml)$ index.php [L,NC]
Upvotes: 2