没有理由,为什么它应该打破static
,除非你在之后写了新规则RewriteCond
。但是,您应该做什么,重写为绝对 URL
RewriteEngine On
RewriteCond %{REQUEST_URI} !static/(.*)\.
RewriteRule ^(.*)$ /index.php?controller=$1 [QSA]
RewriteRule ^action/(.*)$ /actions/$1.php
RewriteCond
长相不一般。除非有理由重写不带点的静态页面.
,否则您应该RewriteCond
将
RewriteCond %{REQUEST_URI} !static/
更新:
为了防止无限重写,您必须添加另一个排除条件
RewriteCond %{REQUEST_URI} !^/index\.php$
也action
必须排除在外
RewriteCond %{REQUEST_URI} !/actions?/
所有放在一起给出
RewriteEngine On
RewriteCond %{REQUEST_URI} !/static/
RewriteCond %{REQUEST_URI} !/actions?/
RewriteCond %{REQUEST_URI} !^/index\.php$
RewriteRule ^(.*)$ /index.php?controller=$1 [QSA]
RewriteRule ^action/(.*)$ /actions/$1.php