我想将301旧网址重定向到新网址.
I want to redirect 301 old url to new url.
我的旧网址是
www.domainname/special
新的网址是;
www.domainname/offers
我尝试了以下代码:
redirect 301 /www.domainname/special www.domainname/offers
但是现在仍然没有重定向&带我到不存在的旧网址.
But still now it's not redirecting & taking me to the old URL which does'nt exist.
推荐答案执行此操作的方法有多种,并且进行了各种重定向,我在下面列出了它们:
There are various ways to do this and various redirects, I've listed them below:
301(永久)重定向:将整个站点永久指向另一个URL.这是最常见的重定向类型,在大多数情况下很有用.在此示例中,我们将重定向到"example"域:
301 (Permanent) Redirect: Point an entire site to a different URL on a permanent basis. This is the most common type of redirect and is useful in most situations. In this example, we are redirecting to the "example" domain:
这使您可以将整个网站重定向到任何其他域
This allows you to redirect your entire website to any other domain
Redirect 301 / example/302(临时)重定向:将整个站点指向另一个临时URL.当您有一个临时的着陆页并计划以后再切换回主着陆页时,这对于SEO很有用:
302 (Temporary) Redirect: Point an entire site to a different temporary URL. This is useful for SEO purposes when you have a temporary landing page and plan to switch back to your main landing page at a later date:
这使您可以将整个网站重定向到任何其他域
This allows you to redirect your entire website to any other domain
Redirect 302 / example/将index.html重定向到特定的子文件夹:
Redirect index.html to a specific subfolder:
这允许您将index.html重定向到特定的子文件夹
This allows you to redirect index.html to a specific subfolder
Redirect /index.html example/newdirectory/将旧文件重定向到新文件路径:
Redirect an old file to a new file path:
将旧文件路径重定向到新文件路径
Redirect old file path to new file path
Redirect /olddirectory/oldfile.html example/newdirectory/newfile.html重定向到特定的索引页面:
Redirect to a specific index page:
提供特定索引页面(设置默认处理程序)
Provide Specific Index Page (Set the default handler)
DirectoryIndex index.html更多推荐
使用htaccess将旧网址重定向到新网址打开的购物车
发布评论