mod_rewrite with anchor link

前端 未结 2 1521
轮回少年
轮回少年 2020-11-30 11:44

I know you can\'t redirect anchor URLs to another page, but is it possible to redirect a URL to only a single anchor?

So

http://www.example.com/vide         


        
2条回答
  •  温柔的废话
    2020-11-30 12:25

    RewriteRule ^/video/(.*) /video.php?title=$1#player [NE,L,R=301]
    

    NE|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.

    Source : http://httpd.apache.org/docs/current/en/rewrite/flags.html

提交回复
热议问题