问题
How do I make it so when a user clicks on, http://localhost/jobwehave.co.za/job/1
They are shown the page for http://localhost/jobwehave.co.za/job?=1
But the url still says http://localhost/jobwehave.co.za/job/1
I am using mod_rewrite in an .htaccess file at the root of the site.
回答1:
Try this,
RewriteRule ^jobwehave.co.za/job/(\d+)$ jobwehave.co.za/job?id=$1
Rick.
回答2:
RewriteEngine On
RewriteRule /jobwehave.co.za/job/([0-9]+)$ /jobwehave.co.za/job?job=$1 [L,QSA]
来源:https://stackoverflow.com/questions/5301583/clean-urls-with-mod-rewrite