.htaccess 重定向(请快速需要帮助)
今天我注意到我的所有链接都没有以正确的方式重定向,所以我失去了链接汁。
有人可以帮我吗。
我所做的是在我的 .htaccess 文件
重定向 301 /tag/my-old-website-link http://www.mynewsite.com/tag/my-old-website-link
现在发生的情况是新链接变成 http://www.mynewsite.comtag/my-old-website-link
因此,在 .com 之后缺少 / 。
任何帮助将不胜感激!
编辑:我找到了解决方案的一部分。 我也有这个重定向 / http://www.mynewsite.com
删除这部分后一切正常。
现在我的问题是如何以正确的方式重定向主页
Today i noticed that all my links are not redirected the right way so i am loosing my link juice.
Can someone help me out.
What i did was this in my .htaccess file
redirect 301 /tag/my-old-website-link http://www.mynewsite.com/tag/my-old-website-link
Now what happens is that the new link becomes http://www.mynewsite.comtag/my-old-website-link
So after the .com the / is missing.
Any help would be appreciated!
Edit: i found a part of the solution.
I also had this redirect
/ http://www.mynewsite.com
After deleting this part everything worked fine.
Now my question is how to redirect the homepage the right way also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现:-)
为了仅重定向主页,我已将其添加到我的 .htaccess 文件中:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com$ [或]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$
RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]
现在每条额外的行都被正确重定向
I found out :-)
To only redirect the homepage i have added this to my .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$
RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]
Now every extra line is redirected correctly