在joomla中重写URL [英] URL rewriting in joomla

查看:119
本文介绍了在joomla中重写URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在joomla中重写url.但网址不应显示"index.php",也不应显示数字(0-9).

I need to rewrite url in joomla. But the url should not be showing "index.php" and no numbers (0-9) as well.

第一个条件: 网址不能为" http://www.abc.com/index.php/components /article ",而不是" http://www.abc.com/components /article ".

1st condition: The url cannot be " http://www.abc.com/index.php/components/article" rather than it should be "http://www.abc.com/components/article".

第二个条件: 网址不能为" http://www.abc.com/components/article/9",其中包含9个数字.

2nd condition: the url cannot be "http://www.abc.com/components/article/9" where it contains 9 number .

这怎么办?

推荐答案

支持 gnomeontherun Hennie .通过菜单结构和每个菜单的别名,您可以控制joomla如何组成url.

In support of the answers from gnomeontherun and Hennie. You have some control over how the url is made up by joomla, through the menu structure and the alias for the each menu.

有时候,即使您不在站点的菜单上显示菜单项,也值得创建.

Sometimes it's worth creating menu items even if you don't show them on a menu on your site.

例如 菜单结构:

Home
-Latest News *(Could be a category blog view)*
--News article 1 *(Link to article but this level need not be shown on menu)*
--News article 2 *(Link to article but this level need not be shown on menu)*

网址应如下所示:

/latest-news    *(for the blog view)*
/latest-news/news-article-1   *(for the article view)*

如果没有与文章相关的菜单项,那么Joomla会使用category + id/article-alias + id等组成网址本身.如果找到菜单项,它将使用菜单的结构来代替.

If there is no menu item which relates to an article, Joomla makes up the url itself using category+id/article-alias+id etc. If it does find a menu item, it will use the structure of the menu instead.

Joomla使用菜单的别名作为实际内容:

Joomla uses the alias of the menus for the actual content:

menu-alias-level1/menu-alias-level2/news-article-1

从一开始使用此方法将使您的URL保持一致,无论它们是通过博客页面路由还是直接访问.这将有助于您的SEO.

Using this method from the beginning will allow you to keep your urls consistent whether they are accessed through the blog page route or directly. This will help with your SEO.

为每篇文章创建一个菜单项当然会很痛苦,但是我知道有些Joomla家伙会发誓并且甚至会在数千页中使用它.

Of course it can be a pain to create a menu item for every article but I know some Joomla guys who swear by it and will do it even for thousands of pages...

这篇关于在joomla中重写URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆