revo
revo

Reputation: 48721

.htaccess rules in a sub directory

I've a folder named test, I can access it via http://domain.com/test. I'm trying to send every requests of http://domain.com/test/XXX (XXX = every thing) to a php file.

I used this in test/.htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /test
RewriteRule ^(.*)$   /control.php?path=$1  [L]
</IfModule>

control.php is in test folder too. But it doesn't work, i don't know in which rule i did a mistake! now every http://domain.com/test/XXX requests shows a 404 not found page!

Upvotes: 1

Views: 58

Answers (1)

anubhava
anubhava

Reputation: 785266

Try this code:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /test/

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ control.php?path=$1  [L]
</IfModule>

Upvotes: 1

Related Questions