如何将网址重定向/放大到非AMP版本?

时间:2017-07-20 19:16:03

标签: wordpress .htaccess amp-html

首先,我想告诉大家,我已经搜索了以下线程的解决方案,但它们不起作用。

.htaccess redirect /amp/ urls to nonamp version

How to redirect amp content to normal mode

Redirect from AMP URLs to Real URLs

我在我的.htaccess中添加了规则:RewriteRule ^(。*)/ amp $ 1 [R = 301,L]:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^(.*)/amp$ $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

但它仍然没有将我的放大器链接带到他们的非AMP原始链接。请帮帮我。

1 个答案:

答案 0 :(得分:0)

您可以在.htaccess文件上尝试以下规则:

RewriteCond %{REQUEST_URI} (.+)/amp(.*)$
RewriteRule ^ %1/ [R=301,L]

测试您的网址

相关问题