0
我有一個網站www.domain.com/jeeves/
。我想在網站上搜索如下所示:.htaccess搜索頁面重寫
http://www.domain.com/jeeves/results/[search_term_here]/[page_number_here]
在搜索時,我希望他們轉到第1頁,當然。在next
或previous
等,瀏覽頁碼。
的.htaccess:
# rewrite all URL's of the format I want to point at my php page with params
RewriteRule ^results/([A-Za-z0-9]+)$/([0-9]+)$ http://www.domain.com/jeeves/search.php?s=$1&page=$2 [NC,L]
# rewrite initial search query to the first page of results
RewriteCond %{QUERY_STRING} s=([^&]*)
RewriteRule ^search http://www.domain.com/jeeves/results/%1/1? [NC,R=301]
這似乎並不工作 - 任何人都可以幫忙嗎?