joomla SEF 在主页中显示的链接与内页不同!
我正在启用 Joomla SEF ,当我链接到主页(首页)文章中的文章时,会得到以下结果:
anywebsite.com/component/content/article/26/141-Z1-Z2-Z3-Z4
但链接时从其他文章中,我得到了我想要的结果:
anywebsite.com/Categor/141-Z1-Z2-Z3-Z4
,并且链接都是相等的:
index.php?option=com_content&view=article&id= 141:Z1-Z2-Z3-Z4&catid=26 有什么想法吗?
编辑:手动链接此 SEF 链接是否是一个好主意,而不是等待 joomla 对其进行转换..?至少作为最后的手段?
I'm enabling Joomla SEF , and get the following results when I link to an article from a homepage (frontpage) article:
anywebsite.com/component/content/article/26/141-Z1-Z2-Z3-Z4
but when linking from other articles I get the result I want which is :
anywebsite.com/Categor/141-Z1-Z2-Z3-Z4
and the link is both equal which is :
index.php?option=com_content&view=article&id=141:Z1-Z2-Z3-Z4&catid=26
any idea?!
Edit: Does manually linking with this SEF link is a good idea , instead of waiting for joomla to convert it .. ? atleast as a last resort?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当没有任何与内容关联的 Itemid(也称为菜单项)时,第一个 SEF URL 是默认的 Joomla SEF 格式。您用于“从主页链接到文章”的内容并未提供 Joomla 构建 /Category/141... URL 所需的 Itemid。
我建议,如果您想要完全控制,请使用另一个 SEF 管理组件,如 AceSEF 或 sh404SEF,它们往往为 URL 管理提供更多控制。
The first SEF URL is the default Joomla SEF format when there aren't any Itemid's (aka menu items) associated with the content. What you use to "link to an article from the hompage" is not providing the Itemid that Joomla needs to build the /Category/141... URL.
I would suggest that, if you want complete control, to use another SEF management component like AceSEF or sh404SEF, which tend to provide more control for URL management.
如果您想删除控制器部分,您只需获取默认菜单项并将其 id 推入路由器的查询中即可。
在您的路由器中:
If you want the controller part removed, you could just get the default menu item and push it's id into the query from your router.
In your router: