1
這些都是重寫規則我通常使用清潔的網址,PHP與Apache國防部重寫:?搜索關鍵字
RewriteRule ^([a-zA-Z0-9\-]+)/?$ index.php?pg_url=$1 [L,QSA]
RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/?$ index.php?pg_url=$2 [L,QSA]
他們將接受請求的URL,例如,
mysite/home
mysite/portfolio/photograhy
,但我怎麼能設置重寫規則seaching如,
mysite/search?photograhy
mysite/search?painting
我試着用下面這一個,
RewriteRule ^search?([a-zA-Z0-9\-]+)/?$ index.php?pg_url=search&keyword=$1[L,QSA]
他們關鍵字SEACH將無法正確顯示,但我會得到這個下面什麼我尋找,
echo $_REQUEST['keyword'];
h[L,QSA] // result
感謝。
非常感謝您的支持! :-) – laukok 2010-11-08 15:03:37
歡迎您! – Stephen 2010-11-08 15:39:57