我有这个htaccess文件:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^/4b/ / [R=301,L]
# This portion checks for the presence of maintenance.enable to toggle
# maintenance mode
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /maintenance.html [R=503,L]
ErrorDocument 503 /maintenance.html
Header Set Cache-Control "max-age=0, no-store"
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/?$ /index.php?/$1 [L]
</IfModule>
但它与网址http://test.com/4b/或http://test.com/4b不匹配 - 相反,它会给我404.我做错了什么?
答案 0 :(得分:0)
显然,我在/
中添加了额外的^/4b/
,而它应该只是^4b/