Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ General Web Design _ Creating index page that will direct to two different sites

Posted by: discking Jan 7 2021, 07:08 AM

I'm trying to create a workaround for an issue with an ecommerce package.

I have an Abantecart store at www.elvisstuff.co.uk The store is located in a sub folder. So I have created an index.html page that redirects to this sub folder whenever a customer uses the www.elvisstuff.co.uk URL.

Abantecart has a feature whereby I can create multiple stores with just one back office. However, despite numerous attempts, I can't get it to work as it should. I have sought help of the Abantecart forums and even got a specialist to look at it and he couldn't help either. (I suspect it might be a hosting issue but can't be sure)

So I'm trying to create a workaround.

The new store uses the URL www.andrewsstuff.co.uk and works perfectly fine as long as the customer prefaces the URL with HTTPS:// However I don't expect all customers will do this. Without the preface the site defaults to the elvisstuff site.

Can I/How do I create one index.html file that will direct customers to one site if they type www.elvisstuff.co.uk and another site if they type www.andrewsstuff.co.uk ?

The code I am currently using to direct to elvisstuff is:


<title>www.elvissstuff.co.uk</title>
<font size="2" face="Arial, Helvetica"><meta
HTTP-EQUIV="REFRESH" content="0;
url=https://www.elvissstuff.co.uk/shop/index.php"></font>

Any help is greatly appreciated.

Posted by: pandy Jan 7 2021, 08:23 AM

QUOTE(discking @ Jan 7 2021, 01:08 PM) *



The new store uses the URL www.andrewsstuff.co.uk and works perfectly fine as long as the customer prefaces the URL with HTTPS://


Nuh. https://www.andrewsstuff.co.uk also redirects to https://www.elvissstuff.co.uk/shop/index.php. Which page doesn't exist BTW.

I think you'll just make it worse with workarounds. This happens for a reason. Do you have an .htaccess file? I have a feeling you do and that you have a redirect in there that's been copied from one place to another and causes all this. Ot that it's too written in such a way that it catches everything.

Is the andewstuff domain in it's own folder parallel to elvisstuff?

Posted by: pandy Jan 7 2021, 08:34 AM

Ot maybe it's just your Meta Refresh tags.

In the andrewstuff.co.uk/index.html you have this.

CODE
<font size="2" face="Arial, Helvetica"><meta HTTP-EQUIV="REFRESH"content="url=https://www.elvissstuff.co.uk/shop/index.php"></font>

That redirects to https://www.elvissstuff.co.uk/shop/index.php not andrewstuff.co.uk/shop/index.html as you said.

Now I can't go to elvissstuff.co.uk at all for some reason, but my guess is you have other meta refreshes in the other pages and they're sort of mixed up.

Side note: those font tags have nothing there to do. You can't have FONT in HEAD.

Posted by: discking Jan 7 2021, 08:42 AM

Thanks for getting back to me so quickly, pandy. The elvisstuff site was working until I started messing with it Lol. I try to fix one problem and create another. I do have an .htaccess file but I've no idea what to do with it.

The andrewsstuff domain is domain mapped to elvisstuff and as such doesn't have a folder at all. I think the site is databased constructed.

The files are under elvisstuff and the database reads that the direct is from andrewsstuff and reads a different set of components to build the site.

Posted by: discking Jan 7 2021, 09:15 AM

I figured out why elvisstuff.co.uk wasn't working - I managed to stick an extra "s" in the middle on the index.html redirect. It works now.

Posted by: pandy Jan 7 2021, 12:07 PM

Right! But you didn't want andrewstuff to redirect to elvisstuff, did you?

Posted by: discking Jan 7 2021, 12:11 PM

No. I want www.andrewsstuff.co.uk to redirect to www.andrewsstuff.co.uk/shop/

Is it possible to get one index page to direct one URL to one place and a second URL to another? If so how do I write the code?

Posted by: pandy Jan 7 2021, 12:14 PM

QUOTE(discking @ Jan 7 2021, 06:11 PM) *

No. I want www.andrewsstuff.co.uk to redirect to www.andrewsstuff.co.uk/shop/

Is it possible to get one index page to direct one URL to one place and a second URL to another? If so how do I write the code?


I don't understand. Have you pointed both domains to the same folder? Do they share the index page? That doesn't work.

Point each domain to it's own folder. Then redirect accordingly.

Posted by: discking Jan 7 2021, 12:25 PM

Yes both domains point to the same folder because that's the way the ecommerce software works. It points all the different domains to the same place and then the database takes over. It identifies which domain has been used and then configures the site accordingly. As the original site was installed into a sub folder the database is looking in the root folder. This wasn't a problem when I had just one store as I created an index page that redirected to the subfolder. However now I have created a second store the redirect still directs to the original store. The database doesn't recognise that the redirect is coming from another URL so configures the original store. I'm hoping that I can get some code that tells the database that a different URL has been used and to configure the store for that URL and not the original one.

Posted by: pandy Jan 7 2021, 12:28 PM

I didn't get half of that but it sounds totally crazy to me.

Posted by: pandy Jan 7 2021, 01:22 PM

Anyhow, you must have some kind of template for each index page. And the redirection you have put in the andrewstuff one goes to the elvisstuff one. So change that to begin with.

Posted by: discking Jan 7 2021, 03:05 PM

It looks like I'm not going to be able to do it. The template doesn't have a redirection. The only place for a URL is already set up with the respective URLs I'm trying to get to work. Thanks for your help though.

Posted by: pandy Jan 7 2021, 06:03 PM

You must have written that Meta refresh tag somewhere. It didn't write itself. So go to the same place and change it to the right URL. That's a starting point anyway.

Posted by: discking Jan 8 2021, 07:04 AM

I've managed to achieve what I wanted to do without using html. Thank you, pandy for your input. Your help is appreciated.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)