htaccess rewrite #anchor to new url?

  • RockmanTV
  • Proficient
  • Proficient
  • RockmanTV
  • Posts: 348

Post 3+ Months Ago

I was wondering if there was a way to use the htaccess file to rewrite an anchor i.e (whatever.com#page2) to go to page2.php on the local server. I know this can be done with JavaScript but if I could do it server side that'd be so much better.

Currently I have my rule setup like this (and it's not working):
Code: [ Select ]
RewriteRule ^#portfolio$ /index.php?page=portfolio [L,NC]


Any suggestions?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Browsers don't send the anchor along with the URI in the request, so no.

Anchors were designed to be in-page navigation, I guess browser makers didn't think a server would ever need to know about them back when every bit was a big deal.
  • RockmanTV
  • Proficient
  • Proficient
  • RockmanTV
  • Posts: 348

Post 3+ Months Ago

That's a bummer... thanks for the info!

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 58 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.