gpt4 book ai didi

all URLs with no trailing slash redirect to include slash(所有没有尾部斜杠的URL都重定向为包含斜杠)

转载 作者:bug小助手 更新时间:2023-10-28 10:41:44 28 4
gpt4 key购买 nike



Just started a new job and the company website is built on Wordpress. All URLs seem to have a trailing backslash for example https://www.digitallearninginstitute.com/courses/professional-diploma/

刚刚开始了一份新工作,公司的网站是建立在WordPress上的。所有URL似乎都有一个尾随反斜杠,例如https://www.digitallearninginstitute.com/courses/professional-diploma/


We are moving to a different CMS and I want to get rid of these so the URLs are https://www.digitallearninginstitute.com/courses/professional-diploma

我们正在转移到不同的CMS,我想摆脱这些,这样URL就是https://www.digitallearninginstitute.com/courses/professional-diploma


From what I can find out this was a requested redirect (I think maybe setup in Wordpress or AWS) where any URLs that dont have the backslash it adds a backslash.

据我所知,这是一个请求的重定向(我认为可能是在WordPress或AWS中设置的),其中任何没有反斜杠的URL都会添加反斜杠。


looking at GSC I see a URL that is indexed without a backslash and the version that has the backslash is not indexed which is good from a duplicated content POV however looking at another page its the opposite (version with the backslash is indexed, non backslash isnt indexed)

在GSC上,我看到一个没有反斜杠的URL被索引,有反斜杠的版本没有被索引,这在重复的内容POV中是好的,但在另一个页面上却相反(带有反斜杠的版本被索引,非反斜杠不被索引)


Question: whats the best practice for moving CMS systems - ideally I dont want to have the backslashes and we are changing the URL slugs (not ideal but we need to)

问:移动CMS系统的最佳实践是什么-理想情况下,我不想有反斜杠,我们正在更改URL插件(不理想,但我们需要这样做)


so for the URL https://www.digitallearninginstitute.com/courses/professional-diploma/ this is changing to https://www.digitallearninginstitute.com/courses/digital-learning-design I was going to setup a redirect from https://www.digitallearninginstitute.com/courses/professional-diploma/ to the new URL and then https://www.digitallearninginstitute.com/courses/professional-diploma (without backslash which gets redirected to the version WITH a redirect) change this to also redirect to the new URL.

因此,对于url https://www.digitallearninginstitute.com/courses/professional-diploma/,这将更改为https://www.digitallearninginstitute.com/courses/digital-learning-design,我将设置从https://www.digitallearninginstitute.com/courses/professional-diploma/到新url的重定向,然后设置https://www.digitallearninginstitute.com/courses/professional-diploma(不带反斜杠,重定向到带有重定向的版本)。


Confusing I know but struggling to see the best way forward to make sure I can change the URLs, include redirects where needed without causing 404s.

我很困惑,但我很难看到最好的前进方式,以确保我可以更改URL,包括在需要的地方重定向,而不会导致404。


Thanks

谢谢


Hopefully with the above solution I can have the old URLs redirect successfully to the new URLs with minimal SEO issues

希望通过上面的解决方案,我可以成功地将旧的URL重定向到新的URL,同时最大限度地减少SEO问题


更多回答

If you are doing the redirects in htaccess - you can just make the slash optional for the redirect. simple regex rule.

如果您在htaccess中执行重定向,则只需将斜杠设置为可选重定向即可。简单的正则表达式规则。

优秀答案推荐
更多回答

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com