htaccess的从HTML到PHP重定向所有,但一个页面

编程入门 行业动态 更新时间:2024-10-27 04:36:36
本文介绍了htaccess的从HTML到PHP重定向所有,但一个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的网站设置了htaccess的指挥从HTML所有网页到PHP如下:

My site is set up with htaccess directing all pages from html to php as below:

RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^website RewriteRule (.*) www.website/$1 [R=301,L] RewriteRule ^(.+)\.html$ www.website/$1.php [R=301,L]

我想成立雅虎网站浏览器,并验证我的账户,我需要以添加元标记或HTML文件添加到我的网站的根文件夹。雅虎拒绝承认我的元标签(我确信我已经正确地添加它)!所以,我唯一的选择是添加HTML文件。

I am trying to set up Yahoo Site Explorer and to verify my account I need to either add a meta tag or add a html file to my website root folder. Yahoo is refusing to recognize my meta tag (I am sure I have added it correctly)! So my only option is to add the html file.

我的HTML文件不断得到重定向到PHP,似乎雅虎找不到了。

My html file keeps getting redirected to php and it seems yahoo cannot find it.

有什么我可以添加到我的htaccess文件,使所有的文件被重定向到从一个文件雅虎需要看到除了PHP的?

Is there something I can add to my htaccess file so that all files are redirected to php apart from the one file yahoo needs to see?

推荐答案

尝试添加这样的条件:

RewriteCond %{REQUEST_FILENAME} !-f

这应该允许实际存在(还有其他可供选择的其他类型的文件)的文件。这是假设它不会搞砸任何其他为已经存在的其他文件。

This should allow any files that actually exist (there are other options for other types of files). This assumes it wouldn't mess up anything else for other files that already exist.

更多推荐

htaccess的从HTML到PHP重定向所有,但一个页面

本文发布于:2023-10-31 16:45:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546680.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   页面   htaccess   HTML   PHP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!