How to use htaccess to rewrite url to html anchor tag (#)

后端 未结 4 486
长发绾君心
长发绾君心 2020-12-11 01:22

I have a situation where I want to take the following URL:

/1/john

and have it redirect using Apache\'s htaccess file to go to

/page.php?id=1&na

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-11 01:36

    This is possible using [NE] flag (noescape).

    By default, special characters, such as & and ?, for example, will be converted to their hexcode equivalent. Using the [NE] flag prevents that from happening.

    More info http://httpd.apache.org/docs/2.2/rewrite/flags.html#flag_ne

提交回复
热议问题