Forums / General Questions / Full URLs in Internal Links

Full URLs in Internal Links

Views: 952

Results 1 to 10 of 10
26 May 2010, 1:16 PM
#1
sephiroth avatar

sephiroth

New Zenner

Join Date:
Nov 2008
Posts:
24
Plugin Contributions:
0

Full URLs in Internal Links

Is there any reason why Zen Cart uses full URLs in its internal links?

the reason I ask is that I'm trying to cut the code down as much as possible, and reckon I can knock off another 12% if I can get rid of the full URLs and just use relative URLs... is there a way to configure the store to do that, or will I have to go through the template and edit all the files?

But I don't want to do it if there is a good reason for the full urls :smile:

Many thanks

26 May 2010, 1:20 PM
#2
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Full URLs in Internal Links

As far as I know ZC only uses relative links (URLs) - in fact, using relative links is recommended throughout.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

26 May 2010, 5:20 PM
#3
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: Full URLs in Internal Links

frank18:

As far as I know ZC only uses relative links (URLs) - in fact, using relative links is recommended throughout.

Yep, that's correct. The links are relative. The link displayed in the browser footer bar (or whatever it's called) is created by adding the store base to the relative url so you see the full url.

Jim
Wheaton Website Services

27 May 2010, 7:05 AM
#4
sephiroth avatar

sephiroth

New Zenner

Join Date:
Nov 2008
Posts:
24
Plugin Contributions:
0

Re: Full URLs in Internal Links

How wierd... all my zen cart generated internal links are full absolute urls...

and here is the demo page from zen cart templates

http://(sorry, site offline)/1-3-8a/

have a look at the source... full urls for internal links as well...

Have I set it up wrong?

27 May 2010, 7:22 AM
#5
sephiroth avatar

sephiroth

New Zenner

Join Date:
Nov 2008
Posts:
24
Plugin Contributions:
0

Re: Full URLs in Internal Links

Had a look at the sites in your sigs... they also use full urls?

27 May 2010, 12:54 PM
#6
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: Full URLs in Internal Links

I think we're talking about the same thing but in a different way. When you view the source code, yes, it's a full url. But the full url is created by Zen from the base url for your site (from the config files) and the relative url within the site. This is what allows you to move a site without re-coding all the links. It's in that sense that they are relative urls.

As to your original question, the SE's like links that are full versus relative.

Jim
Wheaton Website Services

27 May 2010, 2:50 PM
#7
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Full URLs in Internal Links

jeking:

....When you view the source code, yes, it's a full url. But the full url is created by Zen from the base url for your site (from the config files) and the relative url within the site. This is what allows you to move a site without re-coding all the links. It's in that sense that they are relative urls......

Yep, that's exactly how it works. So, don't waste your time trying to shave 12% (???) off the code.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

27 May 2010, 3:41 PM
#8
sephiroth avatar

sephiroth

New Zenner

Join Date:
Nov 2008
Posts:
24
Plugin Contributions:
0

Re: Full URLs in Internal Links

frank18:

Yep, that's exactly how it works. So, don't waste your time trying to shave 12% (???) off the code.

I've already cut out 56% :laugh:

I understand what you are saying, but I still want it gone :) will have a look into the code and see if I can cut it out... can't see any reason for it...

28 May 2010, 1:45 AM
#9
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Full URLs in Internal Links

sephiroth:

...... I understand what you are saying, but I still want it gone :) will have a look into the code and see if I can cut it out... can't see any reason for it...

Good Luck in reinventing the wheel - interested in what you can come up with

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

29 May 2010, 7:01 PM
#10
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,296
Plugin Contributions:
39

Re: Full URLs in Internal Links

sephiroth:

I've already cut out 56% :laugh:

I understand what you are saying, but I still want it gone :) will have a look into the code and see if I can cut it out... can't see any reason for it...

Relative urls are not commonly used in the source view because then scrapers can grab your whole site and display it on their own domain path.

~Melanie

PRO-Webs, Inc. since 2003 https://pro-webs.net/