[Techtalk] Moving Websites: 301 Redirect

Sheila Fenelon sheila at shefen.com
Sun Jun 6 20:40:40 UTC 2010

Gayathri Swaminathan wrote:
> Clicking on an anchor like #artsec is handled by the browser. They don't
>>> result in a request being send back to the server, so your RewriteRule
>>> will never be invoked.
>>> Sheila
> Appears from reading Flags, with [NE] flag available within mod_rewrite,
> anchors could be detected (
> http://httpd.apache.org/docs/2.2/rewrite/rewrite_flags.html)
> Testing it out to see if the theory applies. Will share findings.

That's not for detecting anchors but allows rewrites *too* anchors. This
it the opposite of what Sue is trying to accomplish.

The example they give:

RewriteRule ^/anchor/(.+) /bigpage.html#$1 [NE,R]
The above example will redirect /anchor/xyz to /bigpage.html#xyz

Using [NE] keeps the # character from being converted to hex before
being sent to the browser. It's still up to the browser to detect and
interpret the anchor.

Sheila Fenelon

More information about the Techtalk mailing list