Request For Comment: automatic domain feature
Traumflug last edited by Traumflug
Doing my first steps with PrestaShop worked pretty well. Went to
http://localhost/, ran the installer, eventually started editing the theme. Ah, right, mobile users! Picked the phone to see how it looks there, connected to my desktop and … u-oh, “This page can’t be opened, because Safari can’t find the server” Bummer.
What happened? Well, at installation time, domain name was
localhost. Installer picked this up. Shop software insists on this domain and redirects to it, even if the shop is accessed from another address. Accordingly,
http://mydesktop.localgets redirected to
http://localhost, which is an entirely different host on the phone, of course.
A long googling session later I learned how to fix this misalignment, still I couldn’t resist to teach this shop software proper manners.
*automatic*was born. This is how it looks in Backoffice -> Preferences -> SEO & URLs:
Having it enabled means that thirty bees will no longer try to redirect traffic just because the domain is “wrong”. It’ll just proceed. It’s turned off and works as before when an actual domain name is entered in these fields.
What do you think about this feature? Useful? Might it break other use cases?
Thanks for your comments.
Related Github pull request: https://github.com/thirtybees/thirtybees/pull/250, it’ll go into thirty bees 1.1.0, then.
P.S.: another use case is when copying a shop from one domain to another. No need to adjust shop URLs set to automatic, then.
wakabayashi last edited by
At the moment it’s hard for me to imagine, how I could use this. Is it basically for local testing purposes?
I use multistore… How does it work there?
In multistore this applies to the first shop. All defined domains load their related shop, all other domains load the first shop.
Maybe this feature makes using multistore obsolete in some cases, because defining multiple URLs just to make one shop accessible from multiple domains is no longer necessary.
But that not really what multistore is about is it…
MockoB last edited by
I lost couple of days figure it out how to connect to my home server with other device. Then I finally assigned ip of the server in the router and added that ip in those fields above.
It would be nice feature to have for dumbs like me
@Traumflug Would it be usable in this scenario? I create a standard “tb in a box”, back it up, and restore it in another domain. Simsalabim, working
I create a standard “tb in a box”, back it up, and restore it in another domain. Simsalabim, working
That would be useful!
The pull request got merged! Now it’s an official, upcoming feature
For 1.0.2 or 1.1.0?
dprophitjr last edited by
How can this help out https://github.com/thirtybees/vagrant if we tell vagrant to package it up as a vm box to move elsewhere? @mdekker Modify the installer params?
Teaching the installer to use
*automatic*as default value is certainly possible. Maybe it’s even better, because it keeps the shop working for those who don’t know about these SEO & URL settings, yet.
roband7 last edited by
Why not just make the automatic logic the one and only way this is done?
I’m trying to understand the use case for not doing this automatic, does one exist?
It has always been this way, so it has to be right
I think the original idea was to avoid duplicate content. Y’know, like
shop.com, such stuff. Both get searched by search engine spiders and whoops, two sites instead of one. Then this stuff gets compared and dumb engines detect one shop stealing content from another. Also, having visitors spread over two domains produces links to either of these pages elsewhere and as links pointing to the shop are crucial for site ranking, it’s a loss for both sites.
Such stuff can be done in
.htaccess, of course, but a few years ago presence of
mod_rewritewasn’t a matter of course, so one couldn’t rely on this. Now this redirecting is buried pretty deeply all over the code and can’t be removed easily. Redirects happen everywhere, links get added everywhere, all of them absolute links. Also, some code for writing a proper .htaccess section (think of multishops, too) is required, of course.
Not to forget: multishops use the domain name to find out with which shop they should answer incoming requests.