2014-12-03 55 views
0

我創建了一個網站,CMS製作了簡單的版本1.11.11,並使用了listit2模塊版本1.4.1。CMSMS htaccess重寫ListIt2模塊

現在這個模塊只能以這種形式生成URL:
http://example.com/listit2/item-alias/page-id

現在,我不在乎這是用來顯示正確的模板頁面ID
但由於這是一個多語種的網站我想listit2揹着我(虛擬)語言文件夾apear:
http://example.com/lang/listit2/item-alias/page-id

,所以我CMSMS一般重寫規則之前添加2條重寫線在我的htaccess文件, 。

 
    RewriteCond %{HTTP_HOST} ^lang/listit2 [NC] 
    RewriteRule ^lang/listit2(.*)$ listit2$1 

    # Rewrites urls in the form of /parent/child/ 
    # but only rewrites if the requested URL is not a file or directory 

    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.+)$ index.php?page=$1 [QSA] 

,但似乎並沒有工作,因爲它生成的摘要概述,而不是像http://example.com/listit2/page-id

怎麼樣,我可以解決這個內容的詳細信息頁面?

回答

0

這是否把戲

 
    
    RewriteEngine on 
    RewriteBase/

    #Virtual folders for listit2 
    RewriteRule ^lang/listit2(.*)$ index.php?page=listit2$1 

    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.+)$ index.php?page=$1 [QSA] 
    
0

這不是一個問題的.htaccess。這是ListIt2模塊中的URL生成問題。

在您的摘要模板中,不是使用detail_url的標準變量,您需要將自己的自定義URL放入href中。

例如像這樣(此代碼不能測試,檢查文檔中的實際變量)

<a href="{root_url}/lang/listit2/{$item->item_alias}/{$content_id}" title="Read more about {$item->title}">Read More...</a>