我想在這裏找一些幫助。我正在使用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]
我試圖搜索到處的所有解決方案。仍然沒有運氣。請建議或指出我做錯了什麼?
在此先感謝
'/ sub/en'是否被重定向到'/ sub/en /'?通過將一些隨機文本放入htaccess文件來檢查是否啓用了htaccess,並查看是否收到500錯誤頁面? – Gerben 2012-02-04 17:41:25
通常YAMS在域名後面加上/ en /,所以你會得到www.example.com/en/sub/ – thelastshadow 2012-02-05 23:39:31