我几天前在.htaccess文件中更改了一些内容,现在注意到URL中的括号现在搞砸了。而不是:
url.com/admin/page?delete[]=12345&reasons[]=2
网址显示为:
url.com/admin/page?delete%255B%255D=12345&reasons%255B%255D=2
可能导致这种情况的原因是什么?这是我的.htaccess
文件。它让我发疯了!
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)/$ /$1 [R=302,L,NE]
RewriteRule ^admin/page/?$ admin/page.php [L,NC]
RewriteCond %{THE_REQUEST} \ /(.+)\.php
RewriteRule ^ /%1 [L,R=301]
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^.* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^(.*?)\.(www\.)?domain\.com$ [NC]
RewriteRule ^.*$ https://www.domain.com/profile?user=%1 [L,QSA]
RewriteRule ^([^/]*)-([0-9]+)\.html$ product?name=$1&id=$2 [L,QSA]
ErrorDocument 400 /errors/400.php
ErrorDocument 401 /errors/401.php
ErrorDocument 403 /errors/403.php
ErrorDocument 404 /errors/404.php
ErrorDocument 500 /errors/500.php
答案 0 :(得分:1)
你的规则如下:
ErrorDocument 400 /errors/400.php
ErrorDocument 401 /errors/401.php
ErrorDocument 403 /errors/403.php
ErrorDocument 404 /errors/404.php
ErrorDocument 500 /errors/500.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)/$ /$1 [R=302,L,NE]
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=302,NE]
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=302,L,NE]
RewriteCond %{THE_REQUEST} \ /(.+)\.php
RewriteRule ^ /%1 [L,R=302,NE]
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^(.*?)\.(www\.)?domain\.com$ [NC]
RewriteRule ^.*$ https://www.domain.com/profile?user=%1 [L,QSA,R=302,NE]
RewriteRule ^([^/]+)-([0-9]+)\.html$ product?name=$1&id=$2 [L,QSA]
RewriteRule ^admin/page/?$ admin/page.php [L,NC]
NE
标志。