Forum Moderators: phranque

Message Too Old, No Replies

ModRewrite and # sign...

         

valter

4:38 am on Jul 21, 2005 (gmt 0)

10+ Year Member



Hello,

I need to change an URL like this - "http://www.xdomain/mydoc/mylang/myanchor/" into somtehing like "http://www.xdomain.com/index.php?doc=mydoc&lang=mylang#myanchor".

I've been using Apache Mod Rewrite but apart from the server recognizing the page, I can't get it to go to the anchor. I've tried to use the [NE],[R,NE] flags with no results.

Can someone help me with that?

jdMorgan

4:49 am on Jul 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



valter,

Welcome to WebmasterWorld!

Anchors are processed client-side only - within the browser - and only after the page has loaded, so I'm afraid this won't work. :(

Jim

Wizcrafts

4:52 am on Jul 21, 2005 (gmt 0)

10+ Year Member



Valter;
I tried to do the same thing and learned that it is not do-able in .htaccess. The #anchorname is an html tag, that is recognized and translated within the browser, not at the server. The # sign is a comment in .htaccess and in Perl and other script languages. It cannot be escaped in .htaccess for use as code. Having a # on the same line as your code can also cause server 500 errors.

I settled for leaving the browser hyperlinks to handle those jumps, as they are designed to do.

I hope this information saves you some time. I wasted a lot before learning that it is not possible in .htaccess.

Wiz

valter

5:16 am on Jul 21, 2005 (gmt 0)

10+ Year Member



Ok. I guess I'm going to leave it as it is.
Thanks anyway...