0

我正在开发一个新网站。我的网站的旧名称是 home.html 现在我将其更改为 index.php。当我打开网站时,它正在移动到 home.html 而不是 index.php。如何解决这个问题呢?谁能帮我?

4

2 回答 2

0
<meta http-equiv="refresh" content="0; url=http://yoursite.com/index.php"> 
于 2013-09-06T04:47:33.083 回答
0

index.php 或 index.html应该是您的服务器在访问站点时加载的默认文件,而不是 home.html。尝试清除缓存。如果这没有帮助,它可能是 httpd.conf 中的一个问题 - 但在这种情况下这听起来有点极端。

您还可以考虑在您的 .htaccess 文件中使用 mod_rewrite,以便重定向发生在服务器级别

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /

# redirect home.html to index.php
RewriteRule ^home.html index.php [R=301,L]
于 2013-09-06T04:54:47.840 回答