我有一個Joomla 3.3.6
(編輯:3.5.
)中只有3個級別組織的網站:得到URL擺脫ID(類別和文章)的(的Joomla 3.3/3.4/3.5)
- 四大類(我, II,III,IIII)
- 每一箇中的一些中間類別(A,B,C,...)
- 最後文章分割
- 兩種語言(烯,PT)
的URL
設置Search Engine Friendly URLs
,Use URL rewriting
,Adds Suffix to URL
和multilanguage support
後,應該是形式:
http://www.example.com/en/bigcatiii/intercatA/articlex.html
但正如許多其它具有的Joomla安裝,並要求自的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
但是,如果你瀏覽到它打破機智錯誤:
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]
該URLs
顯示正常,但沒有找到頁面。如果我們能夠使用.htaccess而不是改變Joomla核心,那將會更好。
不過,改變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 /月/ 02):新的賞金爲Joomla最新版本3.5
期待找到一個溫柔的靈魂誰有答案... – 2014-10-08 18:04:47
經過幾個星期等待一些答案,獎金被丟棄,並再次(自動)重新啓動。現在只有4個小時的獎勵獎勵,我沒有和我在一起的Joomla,沒有時間檢查這個答案是否符合要求。所以,關於未經檢查的答案的準確性,我決定獎勵這項獎勵。如果結果不對,我會請作者進行編輯。如果在接下來的日子裏有其他更好的答案,我只能改變接受的答案。非常感謝您的努力,@achedeuzot。 – 2014-10-13 00:20:18
我現在在等待更好的答案。這仍然是一個問題嗎?有更好的,簡單的解決方案嗎? – 2015-03-24 02:42:22