本文介绍了当我将我的普通页面重定向到AMP页面htaccess错误时,将出现500内部服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我重定向AMP页面的常规页面代码。
This is my normal page code for Redirect AMP page.
<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; ?>">
常规页面网址为
这可以正常工作,并且AMP页面网址不起作用
,但是当我添加 ampspecification.php 时,该放大器工作正常其他传递。
This is working fine and AMP page url is not working https://www.themobilesapp.com/ampspecification/Nokia-Lumia-638-specifications-3029but this amp works fine when I add ampspecification.php and other passing.
但是当访问AMP页面网址时,它向我显示以下错误:-
But when is visit on AMP page url then it is showing me this below error:-
包含所有代码的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>
推荐答案
RewriteRule ^ampspecification/([A-Za-z0-9-]+) /ampspecification.php?abc=$1 [L]
此代码行解决了我的问题。
This code line solve my problem.
这篇关于当我将我的普通页面重定向到AMP页面htaccess错误时,将出现500内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!