Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php htaccess-通过修改一个参数更改URL_Php_.htaccess - Fatal编程技术网

Php htaccess-通过修改一个参数更改URL

Php htaccess-通过修改一个参数更改URL,php,.htaccess,Php,.htaccess,我的URL如下所示: page.php?id=1&lan=en 我想通过htaccess将其更改为page-1.html?lan=en。 请注意,我必须同时获得id和lan两个参数的值。 提前感谢。您可以使用下面的代码。我没有试过,但它应该有用 Options +FollowSymlinks RewriteEngine On RewriteRule ^page-(\d*).html$ page.php?id=$1 [L,QSA]

我的URL如下所示:

page.php?id=1&lan=en
我想通过htaccess将其更改为
page-1.html?lan=en

请注意,我必须同时获得
id
lan
两个参数的值。

提前感谢。

您可以使用下面的代码。我没有试过,但它应该有用

Options +FollowSymlinks
RewriteEngine On

RewriteRule ^page-(\d*).html$ page.php?id=$1 [L,QSA]