我有以下网址:
http://site.com/consulting/search.php?searchterm59
并希望将其处理为 search.php 但 url 应该是这样的:
http://site.com/consulting/search/searchterm59
我也试过这个:
我试过这个
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/constulting/search\.php$
RewriteCond %{QUERY_STRING} ^([0-9]*)$
RewriteRule ^(.*)$ http://site.com/consulting/search/%1 [R=302,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)/?$ search.php$1 [L,QSA]
RewriteRule ^/?$ search.php?%1 [L,QSA]