Here's an example link to my website: https://www.example.com/contact.php?ccode=US
Where the US
sets the website language; my website has multilingual support. I Need to transform link to look like this: https://www.example.com/us/
What rules do I need to write in .htaccess to achieve this?
You need to include the following rule in your .htaccess
file:
RewriteEngine On
RewriteRule ^([^/]*)$ /contact.php?ccode=$1 [L]
It will leave you with the desired URL. Just make sure you reset your cache before testing it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.