本文介绍了htaccess的 - 重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个老的文件: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

这篇关于htaccess的 - 重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 04:48