2012-02-04 83 views
0

我想在這裏找一些幫助。我正在使用MODx和YAMS模塊,它是用於多語言的。我遵循YAMS的安裝和設置文檔,但仍然沒有找到404頁面。在YAMS中找不到404頁面

我想獲得:??

本地主機/子/ EN/index.php的ID = 1

本地主機/子/ FR/index.php的ID = 1

本地主機/子/ TH /的index.php?ID = 1

原始鏈接是

localhost/sub/index.php?id = 1

這裏是在htaccess文件中重寫規則。我在「服務器配置」選項卡中獲得了YAMS的重寫規則。

# Friendly URLs 
RewriteEngine On 
RewriteBase /sub/ 

# Fix Apache internal dummy connections from breaking [(site_url)] cache 
RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC] 
RewriteRule .* - [F,L] 

# Exclude /assets and /manager directories from rewrite rules 
RewriteRule ^(manager|assets) - [L] 

# Redirect from mydomain.com/rootname to mydomain.com/rootname/ 
RewriteRule ^en$ en/ [R=301,L] 
RewriteRule ^fr$ fr/ [R=301,L] 
RewriteRule ^th$ th/ [R=301,L] 

# The Friendly URLs part 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^th/(.*)$ index.php?q=$1 [L,QSA] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^fr/(.*)$ index.php?q=$1 [L,QSA] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^en/(.*)$ index.php?q=$1 [L,QSA] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] 

我試圖搜索到處的所有解決方案。仍然沒有運氣。請建議或指出我做錯了什麼?

在此先感謝

+0

'/ sub/en'是否被重定向到'/ sub/en /'?通過將一些隨機文本放入htaccess文件來檢查是否啓用了htaccess,並查看是否收到500錯誤頁面? – Gerben 2012-02-04 17:41:25

+0

通常YAMS在域名後面加上/ en /,所以你會得到www.example.com/en/sub/ – thelastshadow 2012-02-05 23:39:31

回答

1

如果您收到類似本地主機/ EN/index.php文件?在前臺你必須填寫「鏌鋣子目錄」字段「子」 ID = 1的鏈接。你會發現它在模塊 - >山藥 - >其他參數

1

其實問題是.htaccess文件。我從YAMS複製所有.htaccess並替換整個原始.htaccess文件。爲了解決我的問題,我只複製友好的URL部分,並將原來的.htaccess文件中的這部分內容替換掉。

這裏是我從山藥複製和在我的.htaccess文件替換:

# Redirect from mydomain.com/rootname to mydomain.com/rootname/ 
RewriteRule ^en$ en/ [R=301,L] 
RewriteRule ^fr$ fr/ [R=301,L] 
RewriteRule ^th$ th/ [R=301,L] 

# The Friendly URLs part 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^th/(.*)$ index.php?q=$1 [L,QSA] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^fr/(.*)$ index.php?q=$1 [L,QSA] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^en/(.*)$ index.php?q=$1 [L,QSA] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] 

的建議,非常感謝。