如何重写此 URL?
http://website.com/file.php?lang=en 到 http://website.com/file/en
文件名和参数可以改,找了很多题目放了没找到扩展名和GET参数的组合
更新:我现在可以隐藏php扩展如何添加参数
# Turn mod_rewrite on
RewriteEngine On
# hide .php extension
# To externally redirect /dir/file.php to /dir/file
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R=302,L]
# To internally forward /dir/file to /dir/file.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L,QSA]