internal links without http: ?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
OlafNoehring
Forum Members
Forum Members
Posts: 78
Joined: Mon Oct 23, 2006 4:43 pm

internal links without http: ?

Post by OlafNoehring »

Hi

shouldn't all links that are internal only be without the http:// ?
I have noticed, that for examle the tage breadcrumbs, edit, next and previous page and print are putting the http:// in front of the links.
I belive that the http should not be put here for the following reasons
a) what if users build their site on https?
b) for CSS enhancements of links. Example: mark all external links with an icon using the following in your css:

Code: Select all

/* all A tags whose HREF attribute starts with http: */
a[href ^="http:"] {
	padding-right: 18px;
    background: transparent url(icon_mailto.gif) no-repeat center right;
   
}
The second reason was the one that made me start this thread I admit ;-)

What do you think?

Olaf

--
http://www.team-noehring.de
Pierre M.

Re: internal links without http: ?

Post by Pierre M. »

Hello,

Here is my opinion (if I understand well, I agree with you) : I think links should be as relative as possible :
-short, relative, internal links : /products/spaceship.html (or even spaceship.html)
-long, absolute, external links : http://www.cmsmadesimple.org/

BTW, thank you for the CSS tip.

Pierre M.
OlafNoehring
Forum Members
Forum Members
Posts: 78
Joined: Mon Oct 23, 2006 4:43 pm

Re: internal links without http: ?

Post by OlafNoehring »

Hi

I posted the css markups here: http://forum.cmsmadesimple.org/index.ph ... 837.0.html

Yes, your urls are correct, but concerning CMSMS ist should be even shorter. Example
index.php?page=mytarget
will be enough most of the time (of course mytarget is the pagealias)

Olaf
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: internal links without http: ?

Post by kermit »

the root url of cmsms is specified in config.php -- and it appears that provisions are in place for a secure, https, site... generated links should start with https:// if https is detected.

once upon a time when web sites were done the 'hard way', it was more convenient to use relative links ("somepage.html"), or relative to a domain root ("/apath/somepage.html") so a site could be easily moved from server to server. but with a system where menus and links are automatically generated, that doesn't matter any more.

in the case of search engines; it is best to specify the full and exact url for all links, including internal ones.. to ensure that the correct domain, and ONLY the correct domain, gets indexed. consider if your server responds to www.domain.com and domain.com (or even someotherdomain.com) -- if a search engine crawls and indexes all of them, you might find yourself penalized or dropped from that index due to "duplicate content".
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
Pierre M.

Re: internal links without http: ?

Post by Pierre M. »

Yes, spaceship.html is the same as index.php?page=spaceship but with pretty URLs.

Pierre
Pierre M.

Re: internal links without http: ?

Post by Pierre M. »

Hello kermit,
kermit wrote: once upon a time when web sites were done the 'hard way', it was more convenient to use relative links ("somepage.html"), or relative to a domain root ("/apath/somepage.html") so a site could be easily moved from server to server. but with a system where menus and links are automatically generated, that doesn't matter any more.
I disagree : relative links still work, they are prettier so I prefer them. No need for absolute links.
kermit wrote: in the case of search engines; it is best to specify the full and exact url for all links, including internal ones.. to ensure that the correct domain, and ONLY the correct domain, gets indexed. consider if your server responds to www.domain.com and domain.com (or even someotherdomain.com) -- if a search engine crawls and indexes all of them, you might find yourself penalized or dropped from that index due to "duplicate content".
You are describing a broken webserver here. Every (true) webmaster applies some rules for canonical names to publish a website.

Pierre M.
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: internal links without http: ?

Post by kermit »

Pierre M. wrote: You are describing a broken webserver here. Every (true) webmaster applies some rules for canonical names to publish a website.
we aren't always dealing with "true" webmasters here, though are we. ;)  how many do you suppose have things set up 'exactly right'?
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
Pierre M.

Re: internal links without http: ?

Post by Pierre M. »

Yes kermit, I agree. I couldn't resist the temptation to leak what I think is a best practice ;)

Pierre
OlafNoehring
Forum Members
Forum Members
Posts: 78
Joined: Mon Oct 23, 2006 4:43 pm

Re: internal links without http: ?

Post by OlafNoehring »

Hi

I do not see the problem with search engines: If they find and crawl your site - great. I always actually expect (!) that http://www.mysite.com works as well as http://mysite.com
I also expect that search engines are aware of this, especially when the www subdomain has been used.
There is no reason to use absolute links, as "absolute" is simply created with the domain name in CMSMS. This could simply be skipped and - would be even more consistent then: In CMSMS the links in the menu are relative!

Whatever way links are handled in CMSMS - they should be created / treated the same way: Either absolut or relativ. Only this way we (users/admins) can for example create CSS appropiate to the links (what was the initial thought for this thread).

Olaf
cyberman

Re: internal links without http: ?

Post by cyberman »

OlafNoehring wrote: I do not see the problem with search engines: If they find and crawl your site - great. I always actually expect (!) that http://www.mysite.com works as well as http://mysite.com
But there is a problem. Please make a look at the SEO forums.

If there is a page mysite.com and www.mysite.com search engine will see that as double content. You page rank will go down ...
Pierre M.

Re: internal links without http: ?

Post by Pierre M. »

cyberman wrote: there is a problem. Please make a look at the SEO forums.

If there is a page mysite.com and www.mysite.com search engine will see that as double content. You page rank will go down ...
Yes, true. Use a canonical place to publish your content on the web.

Pierre
OlafNoehring
Forum Members
Forum Members
Posts: 78
Joined: Mon Oct 23, 2006 4:43 pm

Re: internal links without http: ?

Post by OlafNoehring »

Hi

well, ok, if this is so (and we should at least mention, that probably google is the search engine we are talking off) I am still asking for short URLs to be created by CMSMS.
It's the admins responsiblity to care about possible subdomains (www.).
a) Either say well, it's ok or
b) forward people from www to non-www (non-subdomain) addresses of your site.

Both is possible and b) is not to hard.
So far CMSMS is inconsistent with it's usage of links. One way or another - it should be consistent, so that admins can find a way to deal to the situation (e.g. CSS for link types, subdomains)

Olaf
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: internal links without http: ?

Post by kermit »

if you don't like the full, absolute links generated by cmsms; write a smarty modifier to strip them out.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
OlafNoehring
Forum Members
Forum Members
Posts: 78
Joined: Mon Oct 23, 2006 4:43 pm

Re: internal links without http: ?

Post by OlafNoehring »

Hi

well, good to know that this works. But
a) I can not write this since I do not know enough about smarty
b) I suppose other admins can not do this either.

Maybe there could be a setting for this - or someone else could write that modifier, maybe as a user defined tag (and post that tag here)?

Olaf
--
http://team-noehring.de
Pierre M.

Re: internal links without http: ?

Post by Pierre M. »

Hello,
OlafNoehring wrote: a) I can not write this since I do not know enough about smarty
b) I suppose other admins can not do this either.

Maybe there could be a setting for this - or someone else could write that modifier, maybe as a user defined tag (and post that tag here)?
I second this nice idea.

Pierre M.
Post Reply

Return to “Developers Discussion”