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

查看:13
本文介绍了当我将普通页面重定向到 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 页面 url 不起作用 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 页面 url 时,它会向我显示以下错误:-

But when is visit on AMP page url then it is showing me this below error:-

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

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天全站免登陆