News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Relative links

Started by Benchtech, January 08, 2012, 05:16:08 PM

Previous topic - Next topic

Benchtech

I have had this problems with my foums before and it can be very irritating. Say I own two domains, example.co.uk and example.com. I have to choose one domain in SMF to use, say I choose example.co.uk, all the links on the forum will be for example.co.uk, whilst I can link in example.com as soon as I click one of the links it takes me to example.co.uk. I don't know if this is possible but it would be good if all the links are relative to the current path, for example if I have two files in the same folder, index and index2 I can simply get to index2 by a link saying index2. There is no need to put in the full path, in this case the domain.

I hope this makes sense and I love SMF!

Ben
Owner, admin and member of benchtech forums.

Arantor

There is absolutely no good reason to go that, and more than one good reason not to.

If you have two different domains pointing to the same forum, presumably for convenience for your users, you're going to have cookie problems, where the cookies of a user on one forum won't transfer over to the other domain (since cookies can't cross domains), so a user logged into one won't be logged into the other.

Then on top of that, you risk one or the other being penalised in search engines for having duplicate content to each other. I'm sure there's more reasons not to do this, as well.
Holder of controversial views, all of which my own.


Benchtech

Quote from: arrowtotheknee on January 08, 2012, 06:47:52 PM
There is absolutely no good reason to go that, and more than one good reason not to.

If you have two different domains pointing to the same forum, presumably for convenience for your users, you're going to have cookie problems, where the cookies of a user on one forum won't transfer over to the other domain (since cookies can't cross domains), so a user logged into one won't be logged into the other.

Then on top of that, you risk one or the other being penalised in search engines for having duplicate content to each other. I'm sure there's more reasons not to do this, as well.

If I have the same domain pointing to the same forum anyway won't it already get penalised in the search results? It doesn't matter if the cookies don't transfer accross the domains as the user will most likely often use the same domain which they remember, eg. I type google.com all the time, and not .co.uk.

Also there must be some way for the cookies to work? Sites like google go ac cross tonnes of domains and remained logged in.
Owner, admin and member of benchtech forums.

Arantor

QuoteIf I have the same domain pointing to the same forum anyway won't it already get penalised in the search results?

Not if it's handled as a redirect. The search engines know how to treat redirects, and do so separately.

QuoteAlso there must be some way for the cookies to work? Sites like google go ac cross tonnes of domains and remained logged in.

No, they don't go across tonnes of domains. They go across *subdomains*. They go, specifically, across google.com domains, e.g. apps.google.com, or www.google.com, not from google.com to google.co.uk. This is how cookies have worked for years.

In fact, that's why you see sites putting resources on a different domain, specifically so that the cookies don't get sent across and it saves bandwidth by not sending the cookie every request.
Holder of controversial views, all of which my own.


Benchtech

Quote from: arrowtotheknee on January 09, 2012, 04:49:23 PM
QuoteIf I have the same domain pointing to the same forum anyway won't it already get penalised in the search results?

Not if it's handled as a redirect. The search engines know how to treat redirects, and do so separately.

QuoteAlso there must be some way for the cookies to work? Sites like google go ac cross tonnes of domains and remained logged in.

No, they don't go across tonnes of domains. They go across *subdomains*. They go, specifically, across google.com domains, e.g. apps.google.com, or www.google.com, not from google.com to google.co.uk. This is how cookies have worked for years.

In fact, that's why you see sites putting resources on a different domain, specifically so that the cookies don't get sent across and it saves bandwidth by not sending the cookie every request.

I understand what you're saying, but if I log into google.com, I can go to google.co.uk on a different tab and I'm logged in. Also am I wrong to have my domain just pointing to the same folder on the server? Should one be a redirect and the other the actual domain used to access the forum?
Owner, admin and member of benchtech forums.

Arantor

QuoteI understand what you're saying, but if I log into google.com, I can go to google.co.uk on a different tab and I'm logged in.

That doesn't work for me. In any case, Google does a whole host of trickery with cookies, and the increased bandwidth issues don't bother them. Mind you, notice how the content served is actually different too, meaning that it's actually beneficial for them to do so, whereas it isn't for two domains that serve the same content...

QuoteShould one be a redirect and the other the actual domain used to access the forum?

Yes.
Holder of controversial views, all of which my own.


青山 素子

Quote from: Benchtech on January 10, 2012, 02:59:07 PM
I understand what you're saying, but if I log into google.com, I can go to google.co.uk on a different tab and I'm logged in.

I can't reproduce that either. I'm signed in via google.com, but not on google.co.uk. Try logging out of both, restarting your browser, and logging into only one.

Also, there are ways to get logins to persist across domains, but they are usually tricky to implement, so they aren't really used often. Most of the time they rely on the various domains checking account status with a single authority. Often you hear them called "Single Sign On" solutions.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Advertisement: