0
我很可能很簡單的mod_rewrite taks掙扎。mod_rewrite不同的URI到一個位置
這是目錄結構,我有:
- 根\
- 翻譯\
- EN \(包含文件,2級深各子文件夾)
- fr \(包含文件,2級深各子文件夾)
- 翻譯\
我想要做的是指向各種動態創建的URL到這些具體的位置,而在地址欄中更改URL。
例如:
mydomain.com/one/
mydomain.com/two/
mydomain.com/three/
- >所有會讀內容從/root/translations/en/index.php
mydomain.com/one/sub1/sub2/
mydomain.com/two/sub1/sub2/
mydomain.com/three/sub1/sub2/
- >會讀從/根含量/ translations/en/sub1/sub2/index.php
mydomain.com/onefr/
mydomain.com/twofr/
mydomain.com/threefr/
- >所有從/root/translations/fr/index.php
mydomain.com/onefr/sub1/sub2/
mydomain.com/twofr/sub1/sub2/
mydomain.com/threefr/sub1/sub2/
會讀的內容 - >將宣讀/root/translations/fr/sub1/sub2/index.php內容
我想是這樣的:
RewriteCond %{REQUEST_URI} !\.css$ [NC]
RewriteRule ^/(one|two|three)/$ /_translations/en/ [L]
RewriteCond %{REQUEST_URI} !\.css$ [NC]
RewriteRule ^/(onefr|twofr|threefr)/$ /_translations/fr/ [L]
,雖然它爲默認的重定向(例如, mydomain.com/one/)我想去的那一刻更深它拋出404
任何線索?
這正是我所需要的!謝謝! – criography 2010-10-22 16:55:14