HTML question

Kev

Lifer
Dec 17, 2001
16,367
4
81
I have an https:// site and all the links on it are document relative. This causes all the links to point to https pages, when they're supposed to point to regular http pages.

How do I get the links to go to http pages without having to make every link an absolute link?
 

jjones

Lifer
Oct 9, 2001
15,424
2
0
I've never thought about this so I can't say for sure but as far as I know, you have to make absolute links. There may be some javascript that can convert your relative links to absolute without having to go and change every single link but then you still probably have to go to every link and put in some kind of onClick action so it's probably easier to make them absolute through straight html.

Something that may make the job easier is to use the search and replace function in your editor and just run a search for href= and replace it with href=http://www.yourdomain.com/. This will replace your relative links with absolute without having to do all of the typing.
 

Kev

Lifer
Dec 17, 2001
16,367
4
81
If I used a <BASE HREF=http://www.mysite.com"> would that F with the security on the current site?
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: maladroit
On the old version of the site, I could.

You could do it by writing some sort of parsing script that converted links on the fly, or by setting up your httpd.conf file with some creative redirects, but you can't do it just with html.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
well, if he sets the base document, then he's just going to have to use full paths for all the https links instead of the http ones.
 

Kev

Lifer
Dec 17, 2001
16,367
4
81
Originally posted by: FeathersMcGraw
Originally posted by: notfred
you can't.

I haven't done any work with https sites, but would the <BASE> element in the <HEAD> of the document work?

Yeah, I'm just wondering if that will mess with the security of the site.
 

Kev

Lifer
Dec 17, 2001
16,367
4
81
Originally posted by: notfred
well, if he sets the base document, then he's just going to have to use full paths for all the https links instead of the http ones.

There's only 1 other https link, and a form. Will the base tag mess with the security at all?
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: maladroit
Originally posted by: notfred
well, if he sets the base document, then he's just going to have to use full paths for all the https links instead of the http ones.

There's only 1 other https link, and a form. Will the base tag mess with the security at all?

It shouldn't affect security.