【问题标题】:Joomla .htaccess mod_rewrite to a menu not an articleJoomla .htaccess mod_rewrite 到菜单而不是文章
【发布时间】:2013-02-28 16:32:41
【问题描述】:

我已经有一个功能性的 .htaccess 重写,它重写一个自定义 URL 并显示某个菜单的内容。

但它没有显示它有一个菜单项,它显示为一篇文章!

我想重写它,使内容显示为菜单(如预期的那样),我该怎么做?

我想重定向中存在一些冲突,或者菜单在我的自定义 .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


    【解决方案1】:

    这最终导致 Joomla 进行的 SEO 重定向发生冲突。

    解决方案是使用通过插件完成的内部重写(我自定义),这样重写将在正确的上下文中显示正确的内容(在这种特殊情况下作为菜单项)。

    正如我所见,由于存在冲突,这是唯一的解决方案,最终不应该/必须不通过 .htaccess 来完成。

    【讨论】:

      猜你喜欢
      • 2012-04-29
      • 2016-02-10
      • 1970-01-01
      • 1970-01-01
      • 2013-09-03
      • 2015-04-15
      • 2013-02-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多