重写获取参数URL

I have a page which have link www.example.com/Test/Leisure-Tours.php?location=15.
I want to rewrite the url to www.example.com/Test/Leisure-Tours/Africa.

Where 15 is the id of Africa

The best solution for this is encrypt id of africa using base64_encode() php function and send it as an url parameter. On the receiving end you can decypt it back using base64_decode() php function.

Mod_rewrite's not going to be able to help you out without access to the server's config files and creating either a mapping outside of your data tier.

There is no way, a rule in an htaccess file is going to know that "Africa" means "15". You'll better off adding some code in the top of the Leisure-Tours.php file, detect when a request is made directly to the php file and then redirect the browser to "Africa". Then, you can use htaccess to pass "Africa" back to the php script, and it'll have to determine the ID from that.

RewriteCond %{QUERY_STRING} ^location=15$ [NC]

RewriteRule ^Test/Leisure-Tours.php$ Test/Leisure-Tours/Africa [R=301,NE,NC,L]