且构网

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

将带有ID的.php URL改为.html

更新时间:2023-02-26 13:01:31

您无法干净地重写url并且不在某处包含变量。你需要做这样的事情:

You can't cleanly rewrite the url and not include the variable somewhere. You'll need to do something like so:

RewriteRule ^([0-9]+)/([^.]+)\.html $2.php?id=$1 [L]

code> http://example.com/10/course.html 。

Which will work for http://example.com/10/course.html.