开发者

What is wrong with my rewrite rule to exclude directory?

Root directory like this:

/index.php
/App
/Extend
/PHPrpc
...

I want exclude sub directory /Extend and /Phprpc from the rules.

The old .htaccess file like this:

<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
开发者_运维技巧

The following is modified by me:

<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(Extend|PHPrpc) - [L]  #exclude directory
    RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>

But I get 500 Internal Server Error.

Any advise?


If you want to exclude the URLs, simply filter it using RewriteCond:

RewriteCond %{REQUEST_URI} !^/(Extend|Phprpc)/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜