[操作疑難] 搞唔掂個mod rewrite

現有的 .htaccess(有錯)
  1. <IfModule mod_rewrite.c>
  2. RewriteEngine On
  3. RewriteBase /
  4. RewriteCond %{REQUEST_FILENAME} !-d
  5. RewriteCond %{REQUEST_FILENAME} !-f

  6. RewriteRule ^(en|ch)/(.*)/(.*)/$ /index.php?lang=$1&co=$2&me=$3 [NC,L]
  7. RewriteRule ^(en|ch)/(.*)/$ /index.php?lang=$1&co=$2&me=$3 [L]
  8. RewriteRule ^(en|ch)/(.*)$ /index.php?lang=$1&co=$2 [L]
  9. RewriteRule ^(en|ch)/$ /index.php?lang=$1&co=$2 [L]
  10. RewriteRule ^(en|ch)$ /index.php?lang=$1 [L]
  11. </IfModule>
複製代碼
RULE 唔想行的,現在只有 http://www.abc.com/en  or  http://www.abc.com/ch   work...

http://www.abc.com/
==> no redirect

http://www.abc.com/en/
==> http://www.abc.com/index.php?lang=en

http://www.abc.com/ch/
==> http://www.abc.com/index.php?lang=ch

http://www.abc.com/en/driver/
==> http://www.abc.com/index.php?lang=en&co=driver

http://www.abc.com/ch/driver/
==> http://www.abc.com/index.php?lang=ch&co=driver

http://www.abc.com/en/shop/
==> http://www.abc.com/index.php?lang=ch&co=shop

另外想加些特殊轉向:
http://www.abc.com/en/promotion2015/
==> http://www.abc.com/index.php?lang=en&co=shop&me=free

搞清楚
Rewrite != Redirect

TOP