php rewritrule

WBOY
WBOYOriginal
2016-06-06 20:23:501247browse

<code>RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]</code>

我的htaccess这样,怎么修改才能使某个目录下的文件不定性到index.php

回复内容:

<code>RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]</code>

我的htaccess这样,怎么修改才能使某个目录下的文件不定性到index.php

没有方式吧,apache的alias这个可以替代下

  1. 例子 排除 images css js目录
    RewriteCond $1 !^(images|css|js)

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn