【发布时间】:2018-02-16 18:09:55
【问题描述】:
我有 WordPress .htaccess 文件,这是它的外观。
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# the following three lines will work for all subdomains
RewriteCond %{HTTP_HOST} !^example\.net$ [NC]
RewriteCond %{HTTP_HOST} !^www\.example\.net$ [NC]
RewriteRule . "http://www.example.net/" [R=301,L]
# the following two lines will redirect non-www to www version of the domain
RewriteCond %{HTTP_HOST} ^example\.net
RewriteRule ^(.*)$ "http://www.example.net/$1" [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# Wordfence WAF
<Files ".user.ini">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
</Files>
# END Wordfence WAF
我想将我的子域重定向到主域。
问题是如果我点赞,subdomain.example.net/anystring 它会成功重定向到example.net
但是,如果我点赞,subdomain.example.net/anystring?anytext 会成功重定向到 example.net?anytext
所以这里附加了?anytext,我需要删除附加到subdomain.example.net的所有内容
我尝试了几件事,但都不成功。
我会为此请求您的帮助。
【问题讨论】:
标签: .htaccess redirect http-redirect