【问题标题】:how to create domain.com/tag/mytag in joomla 2.5如何在 joomla 2.5 中创建 domain.com/tag/mytag
【发布时间】:2014-10-03 00:26:56
【问题描述】:

我正在使用 joomla 2.5 并安装了我的“PLG_CONTENT_SHOWTAGS”插件

这个插件是为底部标签创建网址:

http://domain.com/component/search/keyword

我怎样才能像底部一样使用它:

http://domain.com/tag/keyword

我可以使用 .htaccess 吗?

我不知道我在 htaccess 文件中最喜欢什么。

【问题讨论】:

  • 首先在隐藏菜单的某个地方创建一个链接为带有标签别名的搜索页面。这将摆脱component/search 段并为您提供/tag/ 段。不过,我真的会使用 finder,它为您提供了更多保存和自定义搜索链接的选项。

标签: .htaccess url joomla


【解决方案1】:

以下是如何从一个 url 转发到另一个的基本语法。下面有几个部分

  • (.+):多次匹配任何字符。 例如:标签/关键字+搜索
  • $1:这将采用 tag/ 之后的内容并将其附加到所需的 url。 例如:组件/搜索/关键字+搜索

更多关于重写的信息可以在Apache website找到


 RewriteEngine On
 #Look for the word "tag" followed by a slash, and then the keyword
 RewriteRule ^tag/(.+)$ component/search/$1 [L]

 # Variations of above rule depending on server setup
 # RewriteRule ^tag/(.+)$ /component/search/$1 [L]
 # RewriteRule ^tag/(.+)$ http://www.example.com/component/search/$1 [L]

【讨论】:

  • 他真的在问一个 Joomla 特有的问题。
  • 但他确实问他是否可以使用 htaccess 来做到这一点。使用 Joomla,他可以使用现有的众多重定向/重写模块之一
猜你喜欢
  • 2012-06-21
  • 2023-04-11
  • 1970-01-01
  • 2012-09-04
  • 1970-01-01
  • 1970-01-01
  • 2012-03-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多