anchor in the mod rewrite

Discussion in 'Apache' started by Weirfire, Mar 10, 2006.

  1. #1
    I'm looking to get an anchor in the page for a mod rewrite

    This is what I've tried but it doesnt go to the anchor

    RewriteRule ^anchor-in-page$ /page.php#anchor-in-page [L]


    Any ideas?
     
    Weirfire, Mar 10, 2006 IP
  2. forkqueue

    forkqueue Guest

    Messages:
    401
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Anchor tags are technically part of HTML rather than HTTP, so AFAIK it's not possible to do any sort of HTTP redirect to them. When you enter www.example.com/#blah your browser actually just requests / on host www.example.com - the anchor text is scrolled to as part of the HTML parser.

    You could either redirect using a META REFRESH or some javascript - not as good as a 301 search engine wise but at least it will work.
     
    forkqueue, Mar 12, 2006 IP
  3. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #3
    Thanks for that forkqueue. Saves me a lot of time trying lol
     
    Weirfire, Mar 12, 2006 IP