Home  >  Article  >  Backend Development  >  How to prevent RewriteRule from overwriting a secondary directory

How to prevent RewriteRule from overwriting a secondary directory

WBOY
WBOYOriginal
2016-08-25 10:37:321067browse

目前规则,我想让他排除掉 cb 这个二级目录,就cb目录的话就不要执行这个重写路由,该怎么写啊。。:

<code> RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(!cb)(.*)$ index.php?/$1 [QSA,PT,L]</code>

回复内容:

目前规则,我想让他排除掉 cb 这个二级目录,就cb目录的话就不要执行这个重写路由,该怎么写啊。。:

<code> RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(!cb)(.*)$ index.php?/$1 [QSA,PT,L]</code>
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