Forum Moderators: phranque

Message Too Old, No Replies

Anchor tags on new server

Problem

         

vilepickle

11:08 pm on Aug 17, 2004 (gmt 0)

10+ Year Member



I recently got a dedicated server with Apache, and I've been having an issue that I believe is caused by an Apache setting, but I have no clue.

My anchor tags on my pages (which have worked on an older server) are no longer functioning. When I link something with <a href="#name">, no matter if it is on the same page, it will always link to [domain.com...] When i need is for it to link to the #name on the page I am linking from, but it insists on going to the domain root for some reason. Any help would be appreciated.

jdMorgan

12:26 am on Aug 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



vilepickle,

Welcome to WebmasterWorld!

Check the setting of UseCanonicalName and set it to "off" if it is currently "on".

Jim

vilepickle

5:42 pm on Aug 18, 2004 (gmt 0)

10+ Year Member



Hello,
I tried editing this setting, but it still will not function the way it should. It does the same thing. <snip>

A good example is on a page with a bunch of anchors, like <snip>. You'll notice the TOP links lead to the index, as well as the links at the top (which should link to those anchors on THAT page)

Thanks for any additional help. It's kind of a bother.

[edited by: jdMorgan at 7:59 pm (utc) on Aug. 18, 2004]
[edit reason] Removed specifics per TOS [/edit]

vilepickle

5:44 pm on Aug 18, 2004 (gmt 0)

10+ Year Member



I should have made myself a bit more clear on what I edited. The setting actually WAS off, but I tried turning it on as well. Same difference, it seems.

py9jmas

5:51 pm on Aug 18, 2004 (gmt 0)

10+ Year Member



Anchors are handled purely by the browser. The broswer shouldn't be sending #whatever part of the url to the server, and if it does, Apache ignores it.
Your page has
<base href="http://www.example.com/">

at the top. Therefore all relative links are resolved by the browser relative to www.example.com. Remove the base URL and you should be fine.

vilepickle

5:58 pm on Aug 18, 2004 (gmt 0)

10+ Year Member



Ah, so that's what did it. Thanks for that tip off. It didn't do that when I had the same page on my old server, so I was a bit confused.