【发布时间】:2011-12-20 20:35:35
【问题描述】:
我有一个在 .php 中构建的网站,但我们已使用 "mod rewrite" 将其转换为 .html。 .htaccess中使用的mod重写代码是
RewriteEngine on
RewriteRule ^(.*)\.html$ $1.php
现在问题是我的网站同时出现在.php 和.html。
例如:www.mydomain.com/index.html 和 www.mydomain.com/index.php。
据我所知,它不适合 seo 目的,而且它可能会在搜索引擎中出现重复的内容。
所以我只想在搜索引擎和用户中保留.html [not .php] url。
怎么做?
【问题讨论】:
标签: php mod-rewrite url-rewriting webserver