htaccess的 - 重定向重定向、htaccess

2023-09-02 11:40:08 作者:文艺痞子

我有几个老的文件:homepage.html和home.html的,我敢肯定,人们喜爱他们。所以我想将它们重​​定向到父网址。我已经通过谷歌看了,但他们似乎不符合我的期望。

I have a few old files: homepage.html and home.html which I am sure that people bookmarked them. so I want to redirect them to the parent url. I have looked through google but they seem not to meet what i expect.

例如www.nicetomeetyou.com/home.html和www.nicetomeetyou.com/homepage.html =>这些文件不存在。

for example www.nicetomeetyou.com/home.html and www.nicetomeetyou.com/homepage.html => these files don't exist.

我希望他们被重定向到 HTTP://www.nicetomeetyou

I want them to be redirected to http://www.nicetomeetyou

我要如何做呢?谢谢

推荐答案

您的.htaccess文件应该是这样的:

Your .htaccess file should look like this:

RewriteEngine ON
RewriteRule ^homepage.html$ index.html
RewriteRule ^home.html$ index.html