在.htaccess中应用重定向/重写的问题
我被要求为一个与另一个网站相结合的网站创建一些重定向。我问题的一部分是原始的和新的URL路径不匹配。将根域重新指导到新的不是问题,而是一个单个重定向的问题,因为它继续附加了根域。相反,我可以将所有个人重定向起作用,而不是根源。
我尝试了标准重定向,还使用了重写规则和组合。我发布的几个重定向语句。
我相信我的主要问题是,尽管主要域匹配,但客户端希望更改为子路径。示例是:
Site1.com/ https://www.Site2.com/ProductCore1/
Site1.com/index.php/our-products/ProductCore1 https://www.Site2.com/ProductCore1/
Site1.com/index.php/our-products/ProductCore1/microsoft-excel https://www.Site2.com/ProductCore1-for-excel/
Site1.com/index.php/our-products/mProductCore1/sap-business-objects https://www.Site2.com/ProductCore1-for-sap-business-objects/
Site1.com/index.php/corporate-menu/contact https://www.Site2.com/contact/
每次尝试时,site1.com的根域都会正确地重定向到site2.com/productcore1,但是site1.com/index.php/our-products/productcores/productcore1/microsoft-excel-excel-excel- ://www.site2.com/productcore1/productcore1-for-excel/“ rel =“ nofollow noreferrer”> https://www.site2.com/productcore1/productcore1/productcore1-for-excel/ 。它添加了额外的productCore1/。
任何帮助将不胜感激。干杯
I've been asked to create some redirects for a website that's being moved and combined with another site. Part of my issue is that the original and new url paths don't match. Not an issue to re-direct the root domain to the new, but then none of the individual redirects work because it continues to append the root domain. The opposite is also true where I can have all the individual redirects work, but not the root.
I've tried standard Redirects and also using a rewrite rule and a combination. A couple of the redirect statements I've put in.
I believe my primary issue is that although the primary domain matches, the client wants to change to sub paths. Examples are:
Site1.com/ https://www.Site2.com/ProductCore1/
Site1.com/index.php/our-products/ProductCore1 https://www.Site2.com/ProductCore1/
Site1.com/index.php/our-products/ProductCore1/microsoft-excel https://www.Site2.com/ProductCore1-for-excel/
Site1.com/index.php/our-products/mProductCore1/sap-business-objects https://www.Site2.com/ProductCore1-for-sap-business-objects/
Site1.com/index.php/corporate-menu/contact https://www.Site2.com/contact/
Every time I try, the root domain of site1.com properly redirects to site2.com/ProductCore1, but Site1.com/index.php/our-products/ProductCore1/microsoft-excel redirects to https://www.Site2.com/ProductCore1/ProductCore1-for-excel/. It adds in the extra ProductCore1/.
Any help would be greatly appreciated. Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论