且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

获取URL的最后一部分作为GET参数

更新时间:2022-04-12 22:44:29

我知道了:

RewriteEngine on
RewriteRule ^language/(.*)$ index.php?l=$1

现在,我可以打开类似 http://example.com/foo/bar/language的URL /de/,但浏览器会加载 http://example.com/foo/bar/index.php?l = de

Now i can open URLs like http://example.com/foo/bar/language/de/ but the browser loads http://example.com/foo/bar/index.php?l=de