2011-10-07 39 views

回答

0
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)\/(.*)/$ index.php?ond=$1&cat=$2 [L] 
RewriteRule ^(.*)/$ index.php?ond=$1 [NC] 

這是解決方案。

所需REQUEST_FILENAME保持圖像,JS,CSS等,並編輯 每個URL太HTTP://'.$_SERVER [ 'SERVER_NAME']'的/ etc /等/ etc.jpg

0

您使用的是

例如substituition模式:http://domain.com/list/1

重寫:http://domain.com/index.php?list=&cat=1

重寫規則: RewriteRule /list/([0-9]+) /index.php?list&cat=$1

()周圍[0-9]+結合$1如果你有其他(),他們將結合$2$3

,如果你想周圍的其他方法只適應正則表達式,但usualy你想這樣。

+0

不爲我做了這個工作......我想你應該說: RewriteRule/list /([0-9] +)/index.php?ond=list&cat=$1 你在第一部分忘了ond =。但這仍然不起作用。 – Jordy

0

選項+的FollowSymLinks

RewriteEngine敘述在

的RewriteCond%{QUERY_STRING}貓=(。*)

重寫規則^列表/列表/%1

(我想!)