htaccess rewrite #anchor to new url?

  • RockmanTV
  • Proficient
  • Proficient
  • No Avatar
  • Joined: Oct 12, 2004
  • Posts: 348
  • Status: Offline

Post January 28th, 2010, 11:26 am

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post January 28th, 2010, 11:26 am

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13458
  • Loc: Florida
  • Status: Offline

Post January 28th, 2010, 1:25 pm

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.
Strong with this one, the sudo is.
  • RockmanTV
  • Proficient
  • Proficient
  • No Avatar
  • Joined: Oct 12, 2004
  • Posts: 348
  • Status: Offline

Post January 28th, 2010, 3:20 pm

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 115 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.