问题
i have .htaccess that works fine with shorty rewriting rules like
RewriteRule ^blog/(.+)$ blog_post.php?blogSEOBaslik=$1 [L]
But there is a page about.php
which includes subnavigation via <li><a href="#resume">
named anchor. When i apply a rule like:
RewriteRule ^about/(.+)$ about.php\#$1 [L]
not behave as usual, standart about.php#resume
anchor do.
How do i use named anchors in url rewriting rules?
回答1:
Use NE
flag for not encoding
the resulting URL:
RewriteEngine On
RewriteBase /BAH/
RewriteRule ^about/(.+)$ about.php#$1 [NE,L,R]
来源:https://stackoverflow.com/questions/21391449/how-to-use-sign-as-an-anchor-while-url-rewriting-with-htaccess-on-apache