htaccess查询字符串/?

时间:2017-04-18 09:10:13

标签: wordpress .htaccess redirect

我一直在寻找类似的例子,但我无法在WordPress中找到答案。

在谷歌分析中,我可以看到同一个网址的各种字符串类型。我查看了htaccess文件并停用了缓存系统,但它仍在发生。不知道为什么。

现在在htaccess中我想将所有这些网址重定向到正确的网址:

实施例: //正确:... domain.com/everest-nepal /

// INCORRECT 1:... domain.com/everest-nepal /?/

// INCORRECT 2:... domain.com/everest-nepal /?/ =

//正确3:... domain.com/everest-nepal/?amp(这与放大器有关,对将其重定向到规范网址不感兴趣)

是否有可能在htaccess中应用的重写条件,以重定向所有这些url与这个奇怪的/?*结尾避免放大器?

谢谢和问候 安瑞科

1 个答案:

答案 0 :(得分:0)

一旦你更新了wordpress管理中的固定链接,你就会得到如下的.htaccess代码,你需要在你的根文件夹中创建.htaccess文件,并将其粘贴到代码下面,这应该可行,

enter image description here

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress