This block is in my .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
i want to add following block with my .htaccess, both block run correctly but cant work开发者_如何转开发 together
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
SO i want both block into my htaccess so how can i combined it? Thank You
You need to remove L
from you first RewriteRule ^.*$ /index.php [NC,L]
. Because L
is the last rule.
'last|L' (last rule)
Stop the rewriting process here and don't apply any more rewriting rules. This corresponds to the Perllast
command or thebreak
command from the C language. Use this flag to prevent the currently rewritten URL from being rewritten further by following rules. For example, use it to rewrite the root-path URL('/')
to a real one, e.g.,'/e/www/'
.
精彩评论