问题
i have been trying to find the solution through previous question on SO, but im getting errors when using them.
how to make this url : /viewpost.php?postid=81
as /viewpost/81
in the url so that when /viewpost/81
is entered, it shows the content of /viewpost.php?postid=81
?
回答1:
You must capture the number and append this number as part of the query string
RewriteRule ^viewpost/(\d+)$ /viewpost.php?postid=$1 [L]
来源:https://stackoverflow.com/questions/16155620/htaccess-rewriting-to-remove-query-parameters