当我将我的普通页面重定向到AMP页面htaccess错误时,将出现500内部服务器错误 [英] 500 Internal Server Error is coming when i'm redirecting my normal page to AMP page htaccess error

查看:90
本文介绍了当我将我的普通页面重定向到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; ?>">

常规页面网址为
https://www.themobilesapp.com/Nokia-Lumia-638-specifications-3029

这可以正常工作,并且AMP页面网址不起作用 https://www.themobilesapp.com/ampspecification/Nokia-Lumia-638-specifications-3029
,但是当我添加 ampspecification.php 时,该放大器工作正常其他传递。

This is working fine and AMP page url is not working https://www.themobilesapp.com/ampspecification/Nokia-Lumia-638-specifications-3029 but 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:-


内部服务器错误服务器遇到内部错误或
配置错误,无法完成您的请求。请
通过webmaster@themobilesapp.com与服务器管理员联系,以
通知他们该错误发生的时间,以及您
在此错误发生之前执行的操作。服务器错误日志中可能会提供有关此错误
的更多信息。此外,尝试使用
ErrorDocument处理请求时,遇到500内部
服务器错误错误。

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at webmaster@themobilesapp.com to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

包含所有代码的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内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆