【发布时间】:2013-02-28 16:32:41
【问题描述】:
我已经有一个功能性的 .htaccess 重写,它重写一个自定义 URL 并显示某个菜单的内容。
但它没有显示它有一个菜单项,它显示为一篇文章!
如果我导航到 http://www.mysite.com/en/mymenu/thesubmenu 我可以看到 菜单上下文中的内容(标题有链接、日期未显示等)
如果我尝试转到重写后的 URL http://www.mysite.com/custom,它
像文章一样显示内容(例如:标题没有链接, 显示日期等)。
我想重写它,使内容显示为菜单(如预期的那样),我该怎么做?
我想重定向中存在一些冲突,或者菜单在我的自定义 .htaccess 之前被重定向?
我尝试了所有我能想到的组合。
我当前的 .htaccess(相关部分):
Options +FollowSymLinks
Options -Indexes
RewriteEngine On
RewriteRule ^(en/)?(custom)/?$ /index.php?option=com_content&view=article&id=2308&Itemid=545&lang=en [L]
我试过但没有找到:
(顺便说一句,如果我在浏览器地址栏中输入http://www.mysite.com/?option=com_content&Itemid=545,它会按预期显示菜单)
RewriteRule ^(en/)?(custom)/?$ /en/?option=com_content&Itemid=545 [L]
RewriteRule ^(en/)?(custom)/?$ /?option=com_content&Itemid=545 [L]
RewriteRule ^(en/)?(custom)/?$ ?option=com_content&Itemid=545 [L]
RewriteRule ^(en/)?(custom)/?$ /en/index.php?option=com_content&Itemid=545 [L]
RewriteRule ^(en/)?(custom)/?$ /index.php?option=com_content&Itemid=545 [L]
RewriteRule ^(en/)?(custom)/?$ index.php?option=com_content&Itemid=545 [L]
RewriteRule ^(en/)?(custom)/?$ /en/mymenu/thesubmenu [L]
RewriteRule ^(en/)?(custom)/?$ /mymenu/thesubmenu [L]
RewriteRule ^(en/)?(custom)/?$ mymenu/thesubmenu [L]
【问题讨论】:
标签: .htaccess mod-rewrite joomla2.5