我的.htaccess文件中有这段代码:
RewriteEngine On
RewriteRule \.(css|jpe?g|gif|png|js)$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^authors/([^/]*)$ authors.php?current_page=$1 [NC,L]
RewriteRule ^([^/]*)/([^/]*)$ books.php?tag=$1¤t_page=$2 [NC,L]
RewriteRule ^Books-single/([^/]*)/([^/]*)$ book-single.php?tag=$1&id=$2 [NC,L]
RewriteRule ^Books-by/([^/]*)/([^/]*)$ book-by.php?auth=$1¤t_page=$2 [NC,L]
RewriteRule ^authors-by/([^/]*)/([^/]*)$ authors-by.php?author-by=$1¤t_page=$2 [NC,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
当我输入dunamic url时,地址栏就像localhost:/somefolder/books.php?tag = Love-Books& page = 2这个url仍然有用,我希望所有带查询的url重定向到它的静态版本网址。