开发者

Htaccess mod_rewrite preventing execution of php files

I'm having trouble with a htaccess mod_rewrite preventing php files from being executed directly.

The site seems to be running on an MVC framework (not 100% sure on which one unfortunately) and requests are being sent through a router class. I have a subdirectory which I want to exclude from the routing and have its files be executed directly.

Here is my current htaccess file:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ in开发者_JAVA技巧dex.php?rt=$1 [L,QSA]

I have tried excluding the subdirectory I want to execute directly with the following line but it made no difference:

RewriteCond %{REQUEST_URI} !^subdir/(.*)

Is there any way I can execute the php files in subdir directly? Any help would be much appreciated, thanks.


Have you tried with RewriteCond %{REQUEST_URI} !^/subdir/ ? The REQUEST_URI may start with a /.


RewriteCond %{REQUEST_FILENAME} !-f

This line allows you to execute files directly. If you are getting error 500, check your scripts for fatal errors / uncaught exceptions

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜