简体   繁体   English

joomla完全自定义组件链接

[英]joomla fully customize component link

I made a component and now I want to customize the link for it. 我做了一个组件,现在我想为其定制链接。 I already wrote the router.php. 我已经写了router.php。 The link to the component view (if I use the JRoute function of course) now looks good, except for the first part, which looks like : 组件视图的链接(如果我当然使用了JRoute函数)现在看起来不错,除了第一部分,它看起来像:

http://www.example.com/en/component/componentname/ ... http://www.example.com/en/component/componentname/ ...

don't mind the "en", it's there cause I use JomFish to manage more languages on my site. 不要介意“ en”,这是因为我使用JomFish在网站上管理更多语言。

I want to transform "/component/componentname/" to "/myString/" for example. 我想将“ / component / componentname /”转换为“ / myString /”。

I can't use the menu for this, cause my site displays info from a database, linking this many sites to my menu is impossible. 我不能为此使用菜单,因为我的站点显示数据库中的信息,因此无法将这么多站点链接到菜单。

The only solution I found requires the changing of the Joomla JRoute function (I found only a suggestion, not how it's done :( ). 我发现的唯一解决方案需要更改Joomla JRoute函数(我只发现了一个建议,而不是它的完成方式:()。

What about using mod_rewrite to rewrite your url? 使用mod_rewrite重写URL怎么办?

Basically you put the rewrite rules into your .htaccess file and Apache will handle the rest. 基本上,您将重写规则放入.htaccess文件中,Apache将处理其余规则。

There is a great guide that teaches you all about it on http://www.htmlist.com/how-to/a-simplemod_rewrite-tutorial/ http://www.htmlist.com/how-to/a-simplemod_rewrite-tutorial/上有一个很好的指南可以教您所有这些

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

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