- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我有一个 Joomla 3.3.6
(已编辑:3.5.
)网站仅分为 3 个级别:
设置Search Engine Friendly URLs
后的URL
,Use URL rewriting
,Adds Suffix to URL
and 多语言支持
,应该是这样的形式:
http://www.example.com/en/bigcatiii/intercatA/articlex.html
但自从 Joomla-Baby-Version 以来,许多其他安装了 Joomla 并要求解决方案的人,我得到了:
http://www.example.com/en/bigcatiii/666-intercatA/articlex.html
其中 666 是一个毫无意义的类别 ID
的数字现在浏览答案,我找到了这个答案:
Edit “components/com_content/router.php“
(You’ll probably have to re-do this step every time you update Joomla.)
Replace the lines 38 and 290 with:
$advanced = $params->get('sef_advanced_link', 1);
and Replace line 426 with
->where($db->quoteName(‘alias’) . ‘ = ‘ . $db->quote($segment));
嗯,首先,第426行在原文中已经是这样了。其次,这并不能解决问题。它适用于:
http://www.example.com/en/bigcatiii/intercatA/articlex.html
但如果您浏览到:
,它会中断 404错误:http://www.example.com/en/bigcatiii/intercatA.html
另外,我注意到 ID 号码不同。虽然整个 URL 是
http://www.example.com/en/bigcatiii/666-intercatA/articlex.html
同一类目描述页是
http://www.example.com/en/bigcatiii/333-intercatA.html
还有另一种解决方案听起来更好,但也行不通,基于.htaccess
RewriteEngine on
RewriteBase /
RewriteRule (\d+)-([^/]*) $2 [R=301,L]
URL
显示正常,但找不到页面。如果我们可以提供使用 .htaccess 而不是更改 Joomla 核心的解决方案,那就更好了。
不过,如果其他 google 搜索的建议有效的话,更改 Joomla 核心就好了。
Copy “components/com_content/router.php” to “/templates/your-template/html”
这意味着一旦您将 router.php
移动到您的“本地”,您就不需要在升级后重做所有的东西。 (当然,除非更新了 router.php,以防万一你最好再镜像一次。)
感谢您花时间来解决这个难题!
引用资料
1- Change/ Remove Article ID in URL?
2- Removing the Article ID number
3- How to remove article id in url?
4- Remove article id from url for joomla 3.0
6- Remove article id from joomla 3 URL
7- Remove article id from joomla 3 URL
编辑(2016 年 5 月 2 日):Joomla 最新版本 3.5 的新赏金
最佳答案
我刚刚安装了 joomla 3.5,旧方法对我有用。由于路由器文件中的某些内容已被修改,您必须在 joomla 升级后重复该过程。
./components/com_content/router.php
中的行现在是 34 和 295。
再次将 0
更改为 1
,使其变为:
$advanced = $params->get('sef_advanced_link', 1);
我的网址是http://joomla.lan/en/category-en-gb/article-en-gb
与 Search Engine Friendly URLs
配合使用效果很好。
随着 Adds Suffix to URL
切换到 Yes
一个 .html
被附加到 URL。使用 URL 重写
和 Unicode 别名
可选。在 IIS7 或 Apache 上使用 URL 重写引擎时,您必须将 htaccess.txt
重命名为 .htaccess
并将 webconfig.txt
重命名为 webconfig
。请注意,某些托管商具有限制性服务器配置。如果您收到 500 内部服务器错误
,您可能需要编辑 .htaccess
并注释掉 Options +FollowSymlinks
和/或 Options -Indexes
和/或 RewriteBase/
通过添加前面的 #
。后者已在 Joomla 3.5 中停用。 RewriteBase
设置在 Joomla 安装在子文件夹而不是 Web 根目录中时很有用。
在其他服务器上将 Use URL Rewriting
设置为 No
。
我无法重现您的问题,这两个代码编辑后一切正常。请再试一次,如果您无法解决,请发布确切的行为(网址、错误等)。如果无法修复它,您可能需要重新安装源。
关于php - 从 URL (Joomla 3.3/3.4/3.5) 中删除 ID(类别和文章),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26168517/
hello world tutorial对于 Joomla 状态: $mainframe is a global variable in Joomla that has lots of useful
我已经通过了:http://docs.joomla.org/How_to_add_breadcrumbs 和 http://api.joomla.org/Joomla-Framework/Applic
在为模块设置添加参数字段时,我正在寻找可能的过滤器列表。 我知道 Text form field type 的示例中存在 filter="raw"和 filter="integer". 但是这些字段的
关闭。这个问题需要更多focused .它目前不接受答案。 想改善这个问题吗?更新问题,使其仅关注一个问题 editing this post . 5年前关闭。 Improve this questi
是否可以为 Joomla 1.5 后端和前端实现单点登录。我发现当管理员例如在后端登录并且需要在前端执行一些用户功能时必须再次登录,这有点多余。有没有实现单点登录的方法? 最佳答案 乔姆拉!被实现为两
我们如何在 joomla 中渲染带有标题的模块。因为现在,我可以根据位置渲染模块,但它不包括模块标题。 这是我渲染模块的方式。 title); echo JModuleHelper::renderMo
我正在 joomla 中开发一个自定义搜索模块。所以我正在使用 joomla 的内置数据库连接和功能。 问题是我想在这个模块中使用分页类,但不知道任何提示。 请帮我解决这个问题。 谢谢。 最佳答案 第
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题? Update the question所以它是on-topic对于堆栈溢出。 10年前关闭。 Improve this qu
我在joomla中使用youtube视频,其中代码如下:- [jv_youtube url="https://www.youtube.com/watch?v=8Di0IOQssOM&rel=0" wi
我使用 onContentPrepare 事件将此 [test] 更改为其他文本 o prinf html,如 wordpress 短代码,但没有任何变化。 出了什么问题? 这是shortcodejd
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,
请先转到www.espacioasir.com,然后注意第二篇文章如何“压碎”到左侧-文章正常宽度的一半。 无论如何,我认为我无法解释得更多,我的问题很清楚:为什么会这样?我确实想提及一下,本文的内容
有些人可能知道,Wordpress 在设置中有一个选项,允许在子目录中安装站点,同时将站点 URL 设为主域。它类似于“站点 url”和“Wordpress url”。我在 Joomla 中寻找类似的
我遇到的这种情况:安装了 joomlaxy/JSPT/Payplans 的 joomla 运行良好。 现在,我在/pages 文件夹中做了一个小的 php 脚本,用于在特定用户类型的模板中使用,它调用
我知道如何为 Joomla 1.6 创建一个模块。但是我听说可以在同一个 XML 安装文件中添加一组 Joomla 1.5 参数和一组 Joomla 1.6 参数,以使只有一个包与 1.6 和 1.5
自从昨晚 Joomla 3.0 Alpha 发布以来,我想尝试开始将我编写的 Joomla 2.5 组件转换为新的 Joomla 3.0。我一直在关注所有的开发小组,他们说 JController、J
我在 Joomla 1.5 中工作并开发了一个组件,该组件有 2 个 View ,在两个 View 中具有相同的部分。我正在重复代码,因为我在 2 个不同的 View 中使用了相同的代码。所以我想知道
我正在构建一个自定义 Joomla 组件,并将其添加到我的模板 (default.php) 文件(它使用 HTTP POST)中的表单中: echo JHTML::_( 'form.token' );
拿起 Joomla 的最快方法是什么?书籍,培训等?我们希望在 Joomla 中培训 10 名中高级 Java 开发人员。 最佳答案 如果你想节省时间,不要从官方的 joomla 文档开始。转至 ht
我之前以这种方式从 Joomla 文章中添加了 Joomla 模块:{loadmodule mod_name}但是这次我需要从中传递参数。 如何将文章中的参数传递给 Joomla 模块? 最佳答案 您
我是一名优秀的程序员,十分优秀!