与htaccess的重定向问题(页上的一个域名同一页上的另一个)重定向、域名、问题、htaccess

2023-09-02 00:58:48 作者:能滚多远就滚多远

我想重定向几页到一个新的领域,我以前做过这一点,但由于某种原因,我不能得到code工作。

I'm trying to redirect a few pages to a new domain and I have done this before but for some reason I can't get the code to work.

RewriteEngine On
Redirect 301 http://domain.com/page1.html http://domain2.com/page1.html

有人能看到我要去哪里错了?

Can anyone see where I'm going wrong?

推荐答案

既然你说你只需要指挥你的网页的一些,而不是所有的人,你可以这样做:

Since you say you only want to direct a FEW of your pages and not all of them, you can do:

RewriteEngine On
Redirect /~myaccount/oldpage.html http://www.newsite.com/newpage.html

您指定的路径页当前服务器后面的URL重定向到。

You specify the path to the page on your current server followed by the URL to redirect to.

或者你可以这样做:

RedirectMatch 301 ^/oldpage.html$ http://www.newsite.com/newpage.html
 
精彩推荐
图片推荐