简体   繁体   中英

Rewrite a url with multiple parameters

我正在研究一个php项目,发现很难用多个参数重写url

RewriteRule ^search/([0-9]+) search/search.php?profile_id=$1&class=$2&tutor=$3

To use $1 , $2 , $3 , you need to use 3 capturing groups. So change your RewriteURL pattern to something like this:

^search/([0-9]+)/([^/.]+)/(.*?)$

But this will break your relative paths. Better use,

<base href='/'>

Read this article to know more about using base tag

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM