如何从url中删除?domain =

时间:2014-03-25 10:18:54

标签: .htaccess

我现在真的很困惑,我已经通过.htaccess删除了index.php,但是无法从url中删除?domain =,我尝试了一些例子:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)/?domain/?$ /$1/ [L,R=301]
RewriteRule ^domain/(.*)$ /$1 [L,R=301]

还有更多,帮帮我

1 个答案:

答案 0 :(得分:1)

在目标URI的末尾添加?以去除查询字符串:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)/?domain/?$ /$1/? [L,R=301]
RewriteRule ^domain/(.*)$ /$1? [L,R=301]