2013-07-26 87 views

回答

5

你需要使用.htaccess文件來做這個重寫操作,而不需要在瀏覽器中調用url, 嘗試下面的代碼

RewriteEngine On #remove this if already added 
RewriteRule ^search/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ search.php?s1=$1&s2=$2 [NC,L] 
0

我這樣做:

RewriteEngine On #if not already on. 
RewriteCond %{REQUEST_FILENAME} !-f #only if it is not calling a file that actually exists 
RewriteCond %{REQUEST_FILENAME} !-d #only if it is not calling a directory that actually exists. 
RewriteRule ([a-z0-9]+)(/*)([a-z0-9]*)(/*)([a-z0-9]*)(/*) search.php?v1=$1&v2=$3 [L,NC,QSA] 

這甚至會工作,如果你只去/移動/(假設你的search.php就可以搞定。)

HTH