这是我的重定向AMP页面的常规页面代码。
<meta name="original-source" content="https://www.themobilesapp.com/<?= $abc; ?>">
<link rel="canonical" href="https://www.themobilesapp.com/<?= $abc; ?>">
<link rel="amphtml" href="https://www.themobilesapp.com/ampspecification/<?= $abc; ?>">
正常页面网址是 https://www.themobilesapp.com/Nokia-Lumia-638-specifications-3029
此工作正常且AMP页面网址无效https://www.themobilesapp.com/ampspecification/Nokia-Lumia-638-specifications-3029 但是当我添加 ampspecification.php 和其他传递时,这个放大器工作正常。
但是当访问AMP页面网址时,它会向我显示以下错误: -
内部服务器错误服务器遇到内部错误或 配置错误,无法完成您的请求。请 请通过webmaster@themobilesapp.com与服务器管理员联系 告知他们此错误发生的时间以及您的行为 在此错误之前执行。有关此错误的更多信息 可能在服务器错误日志中可用。另外,500内部 尝试使用时遇到服务器错误错误 ErrorDocument来处理请求。
包含所有代码的htaccess文件
Options +FollowSymLinks -MultiViews -Indexes
<IfModule mod_rewrite.c>
DirectoryIndex index.php
RewriteCond %{HTTP_HOST} ^themobilesapp.com$ [NC]
RewriteRule (.*) https://www.themobilesapp.com/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
ErrorDocument 404 404error.php
RewriteRule ^([A-Za-z0-9-]+)$ specification.php?abc=$1 [L]
RewriteRule ^news/([A-Za-z0-9-]+)?$ news.php?abc=$1 [L]
RewriteRule ^ampnews/([A-Za-z0-9-]+)?$ ampnews.php?abc=$1 [L]
RewriteRule ^profile/([A-Za-z0-9-]+)?$ profile.php?id=$1 [L]
</IfModule>
答案 0 :(得分:0)
RewriteRule ^ampspecification/([A-Za-z0-9-]+) /ampspecification.php?abc=$1 [L]
此代码行解决了我的问题。