Php 如何在htaccess中使用RewriteEngine传递2个参数
你好,这是我所拥有的:Php 如何在htaccess中使用RewriteEngine传递2个参数,php,.htaccess,url-rewriting,Php,.htaccess,Url Rewriting,你好,这是我所拥有的: RewriteRule ^page_([^/]*)$ /page.php?id=$1 [L] 当链接为domain.com/page_3时,它会显示page.php/id=3。现在我想这样传递:domain.com/page_3&u=username。但它一直说找不到页面。我将该行更改为:RewriteRule^page([^/]*)$/page.php?id=$1&u=$2[L](不起作用) 我错过了什么 您可以对两个参数进行此操作 RewriteRule ^page
RewriteRule ^page_([^/]*)$ /page.php?id=$1 [L]
当链接为domain.com/page_3时,它会显示page.php/id=3。现在我想这样传递:domain.com/page_3&u=username。但它一直说找不到页面。我将该行更改为:RewriteRule^page([^/]*)$/page.php?id=$1&u=$2[L]
(不起作用)
我错过了什么 您可以对两个参数进行此操作
RewriteRule ^page_([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ /page.php?url=$1&url2=$2 [L,QSA]
这是三个人的,依此类推
RewriteRule ^page_([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$/([a-zA-Z0-9_-]+)$ /page.php?url=$1&url2=$2&url3=$3 [L,QSA]