如何处理导致 URL 截断的错误
我在德国一家休闲门户公司的网站上工作。我在处理截断的网址时遇到问题。如果您要访问网络链接 http://www. Regiondo.de/staedte/duesseldorf/lernen-unterricht-duesseldorf/musikkurse-duesseldorf,位于屏幕左侧KATEGORIEN,您会看到 Gitarrenunterricht (1)。
如果您单击它,用户将被重定向并收到 404 页面未找到错误,因为用户应该重定向到的实际 url 是 http://www.regiondo.de/staedte/duesseldorf/lernen-unterricht-duesseldorf/musikkurse-duesseldorf/gitarrenunterricht-duesseldorf 被截断,“duesseldorf”位于网址末尾截断为 duessel
现在我查看了该网页的 HTML 代码,它具有特定的代码:-
a href=/staedte/duesseldorf/lernen-unterricht-duesseldorf/musikkurse-duesseldorf/gitarrenunterricht-duessel>Gitarrenunterricht (1)
现在我明白了,通过更改duessel 到 duesseldorf 我可以纠正这个问题,但是 HTML 中的这个 url 截断也发生在许多其他 url 上(所有这些 url 都是故意正确输入的)。后端可能存在哪些问题或错误可能导致此类 URL 截断问题。由于我是网络开发的新手,我很想听听您的建议和意见。谢谢。
I am a working on a website for a leisure portal company in Germany. I am having trouble dealing with a truncated url. If you were to go to the web link http://www.regiondo.de/staedte/duesseldorf/lernen-unterricht-duesseldorf/musikkurse-duesseldorf , on the left side of the screen under KATEGORIEN, you would see Gitarrenunterricht (1).
If you click on it, the user is redirected and gets a 404 page not found error, since the actual url to where the user is supposed to redirected is http://www.regiondo.de/staedte/duesseldorf/lernen-unterricht-duesseldorf/musikkurse-duesseldorf/gitarrenunterricht-duesseldorf , is truncated and 'duesseldorf' at the end of the url truncates to just duessel
Now I have looked at the HTML code for the webpage and it has the specific code:-
a href=/staedte/duesseldorf/lernen-unterricht-duesseldorf/musikkurse-duesseldorf/gitarrenunterricht-duessel>Gitarrenunterricht (1)
Now I understand that by changing duessel to duesseldorf I can rectify this issue but this url truncation inside the HTML is happening for many other urls as well(all of which were knowingly typed correctly). What are the possible problems or bugs from the backend which could cause such URL truncation problems. Since I am new to web development I would love to hear your suggestions and views. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的 Magento 版本中,将产品设置为不在 URL 中使用类别名称。然后问题就消失了。
http://www.example.com/index.php/ admin/system_config/edit/section/catalog/
然后在搜索引擎优化部分:
使用产品 URL 的类别路径 ->不
In your Magento build set the products to not use the category name in the URLs. Then the problem goes away.
http://www.example.com/index.php/admin/system_config/edit/section/catalog/
Then in Search Engine Optimisations section:
Use Categories Path for Product URLs -> No