0

My site uses strings such as:

http://www.website.com/?action=blue_widgets

I'd like to rewrite this to display:

http://www.website.com/blue_widgets

Firstly, is this advisable? Secondly how should I achieve this?

4

1 回答 1

0

这应该适合你。将此添加到您的 .htaccess 文件中。

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+) /?action=$1&%{QUERY_STRING} [L] 
于 2013-07-04T15:09:40.903 回答