.htaccess rewrite URL with a question mark “?”

后端 未结 2 1116
忘了有多久
忘了有多久 2020-11-30 14:11

My aim is this URL:

component/users/?view=registration

To:

registration.html

the .htaccess

2条回答
  •  无人及你
    2020-11-30 14:35

    RewriteRule ^component/users/\?view=registration$ registration.html$ [R=301,L]
    

    You need a \ because ? is part of a regular expression. To Use it as a string u need to escape it with a \

    Linktip: http://ole.michelsen.dk/tools/regex.html

提交回复
热议问题