使用htaccess将旧网址重定向到新网址打开的购物车

编程入门 行业动态 更新时间:2024-10-21 16:25:49
本文介绍了使用htaccess将旧网址重定向到新网址打开的购物车的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想将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将旧网址重定向到新网址打开的购物车

本文发布于:2023-10-31 15:53:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546558.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网址   购物车   到新   重定向   htaccess

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!