简体   繁体   English

在joomla中创建类别网址

[英]Creating Category Url in joomla

I create new category in Joomla 3.3 name water . 我在Joomla 3.3名称water创建新类别。 I wan to display that category page like http://www.myserver.com/Joomla/water It's display 404 error. 我想显示该类别页面,例如http://www.myserver.com/Joomla/water它显示404错误。 If i create menu for that so it's display. 如果我为此创建菜单,则显示它。 I Have many categories so help me to see category page without create menu. 我有很多类别,因此可以帮助我查看没有创建菜单的类别页面。

You can achieve this by using url rewriting like below. 您可以使用以下网址重写来实现此目的。

Put the following code in your joomla .htaccess file after RewriteEngine On statement. RewriteEngine On语句之后,将以下代码放入joomla .htaccess文件中。

 RewriteRule jcats/(.*)$ index.php?option=com_mycomponent&task=mycontroller.viewitem&catalias=$1 [NC,L]

In this way any url like http://example.com/jcats/about-us would give you the last parameter as catalias variable and either with the help of a new component called com_mycomponent or com_content can be used to display the category or articles in the category. 这样,任何类似http://example.com/jcats/about-us的 url都会为您提供最后一个参数,即catalias变量,并且可以借助名为com_mycomponent或com_content的新组件来显示类别或文章。在类别中。

I have done this beautifully for one of my website. 我为我的一个网站做的很漂亮。 If you need further help, feel free to revert back . 如果您需要进一步的帮助,请随时返回

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM