Zen Cart Logo
Forums / Basic Configuration / Wrong URL...

Wrong URL...

Views: 3,607

Results 1 to 17 of 17
16 Jul 2014, 5:07 AM
#1
micro007 avatar

micro007

New Zenner

Join Date:
Jan 2008
Posts:
43
Plugin Contributions:
0

Wrong URL...

This problem started when I put the site live. This is my second Zen Cart and this one is done exactly the same as the previous one. Which works perfectly at the same hosting company with no URL issues. I basically installed Zen Cart on the server added a couple of addons and redid the graphics. Configured all the necessary files per the template instructions and added HTML redirects to point to the sub-domain of the parent directory which is setup through the CP Panel of my hosting company. So I have an HTML Redirect and a CP Panel URL redirect that dumps you right from http://www.blackwidowarms.com to https://store.blackwidowarms.com this works perfectly in all browsers. I've ensured that the configure.php is as follows -

define('HTTP_SERVER', 'http://store.blackwidowarms.com');
define('HTTPS_SERVER', 'https://store.blackwidowarms.com');

define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');

define('DIR_FS_CATALOG', '/home/content/**/*******/html/store/');

If you get to https://store.blackwidowarms.com from anywhere then click on a link within the website it takes you to my main account domain and then mydomain.com/store which is where the files for zen cart sit. No secured link or anything. I've talked to the hosting company and they have no clue! Please tell me I don't have to gut and start over.... everything works and things can be ordered. My entire domain has a SSL cert so I'm not worried about that. I just need the links to show his business! I haven't done too much database programming but I can get in there if anyone thinks that this might be where the problems is. Any help would be appreciated.....

16 Jul 2014, 7:36 AM
#2
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: Wrong URL...

Do you have a .htaccess file in the root of one or both your stores?

16 Jul 2014, 7:59 AM
#3
micro007 avatar

micro007

New Zenner

Join Date:
Jan 2008
Posts:
43
Plugin Contributions:
0

Re: Wrong URL...

picandnix:

Do you have a .htaccess file in the root of one or both your stores?

I'm not sure, been so long since I've messed with that stuff. There's a .htaccess file in the includes directory but not in the root.

16 Jul 2014, 10:24 AM
#4
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: Wrong URL...

micro007:

I'm not sure, been so long since I've messed with that stuff. There's a .htaccess file in the includes directory but not in the root.

That's cool, that's how it should be.
So do you have redirects set-up through your hosting account?

16 Jul 2014, 5:55 PM
#5
micro007 avatar

micro007

New Zenner

Join Date:
Jan 2008
Posts:
43
Plugin Contributions:
0

Re: Wrong URL...

picandnix:

That's cool, that's how it should be.
So do you have redirects set-up through your hosting account?

Yes, I have the regular domain and the subdomain on my server and the redirects go through the CP at the hosting company from http://www.blackwidowarms.com to https://store.blackwidowarms.com and then I also put a html redirect in the http://www.blackwidowarms.com root like this -

<script type="text/javascript">
            window.location.href = "https://store.blackwidowarms.com"
</script>
<script language=JavaScript> var message="Function Disabled!"; function clickIE4(){ if (event.button==2){ alert(message); return false; } } function clickNS4(e){ if (document.layers||document.getElementById&&!document.all){ if (e.which==2||e.which==3){ alert(message); return false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4; } else if (document.all&&!document.getElementById){ document.onmousedown=clickIE4; } document.oncontextmenu=new Function("alert(message);return false") </script>

<table cellspacing="0" cellpadding="0" align="center" vspace="0">
  <tr>
    <td><img src="images/drop_logo.png" width="275" height="520" vspace="0" hspace="0" /></td>
  </tr>
  <tr>
    <td><center><font color="#CCCCCC">If you are not redirected automatically,<br />please click this <a href='https://store.blackwidowarms.com'><font color="#FF0000">link</font></a>.</font></center></td>
  </tr>
</table>

I think it might be in the database of the zen cart somewhere. Because, I get to where it needs to go https://store.blackwidowarms.com and then when you click on the links it shows the URL of the main domain for the account.

I just noticed as well that I can only get into the backend by going to mydomain/store/admindirectory..... if this helps?

16 Jul 2014, 6:39 PM
#6
micro007 avatar

micro007

New Zenner

Join Date:
Jan 2008
Posts:
43
Plugin Contributions:
0

Re: Wrong URL...

I noticed this in the Zen Cart, which I can now only get to if I type my domain/store and admin directory, "server information" under -

session.cookie_domain .maindomain.com

Local value shows maindomain

Should this be the case?

16 Jul 2014, 6:51 PM
#7
micro007 avatar

micro007

New Zenner

Join Date:
Jan 2008
Posts:
43
Plugin Contributions:
0

Re: Wrong URL...

Also I noticed that the server name is -

_SERVER["SERVER_NAME"]	maindomain.com

Not the blackwidowarms.com or store.blackwidowarms.com. Also I noticed that -

_SERVER["HTTP_REFERER"]	http://maindomain.com/store/admindirectory/

Not the blackwidowarms.com or store.blackwidowarms.com. Also this -

_SERVER["DOMAIN_NAME"]	maindomain.com

Not the blackwidowarms.com or store.blackwidowarms.com. Not sure just reaching at this point that it might be in the database somewhere and that it might be in one spot that is pointing everything to maindomain/store instead of https://store.blackwidowarms.com......

18 Jul 2014, 6:48 PM
#8
micro007 avatar

micro007

New Zenner

Join Date:
Jan 2008
Posts:
43
Plugin Contributions:
0

Re: Wrong URL...

micro007:

Also I noticed that the server name is -

_SERVER["SERVER_NAME"] maindomain.com

> Not the blackwidowarms.com or store.blackwidowarms.com. Also I noticed that -
> ```
_SERVER["HTTP_REFERER"]	http://maindomain.com/store/admindirectory/

Not the blackwidowarms.com or store.blackwidowarms.com. Also this -

_SERVER["DOMAIN_NAME"] maindomain.com

> Not the blackwidowarms.com or store.blackwidowarms.com. Not sure just reaching at this point that it might be in the database somewhere and that it might be in one spot that is pointing everything to maindomain/store instead of <https://store.blackwidowarms.com>......


I lost the only person who would give me guidance?????  :unsure:
18 Jul 2014, 7:34 PM
#9
micro007 avatar

micro007

New Zenner

Join Date:
Jan 2008
Posts:
43
Plugin Contributions:
0

Re: Wrong URL...

Okay, after much haggling with different people at my hosting company they now know to listen to the customer a little more and believe he may know more than them..... The domain had dropped from my domains tab which shows all domains under me whether they are hosted or "dns only", which made it shift over to mydomain/store so I had to add it again and then give the new domain controller addresses to the domain name registrar, I know it was the server that dropped them because I had already given two domain controller addresses to the registrar. Boo-yeah! Yeah as simple as that! Told them it was on their end....

18 Jul 2014, 8:52 PM
#10
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: Wrong URL...

micro007:

Okay, after much haggling with different people at my hosting company they now know to listen to the customer a little more and believe he may know more than them..... The domain had dropped from my domains tab which shows all domains under me whether they are hosted or "dns only", which made it shift over to mydomain/store so I had to add it again and then give the new domain controller addresses to the domain name registrar, I know it was the server that dropped them because I had already given two domain controller addresses to the registrar. Boo-yeah! Yeah as simple as that! Told them it was on their end....

Result!! :cheers:

29 Jul 2014, 10:25 PM
#11
micro007 avatar

micro007

New Zenner

Join Date:
Jan 2008
Posts:
43
Plugin Contributions:
0

Re: Wrong URL...

Well I thought I was done but it has not worked and the URL still shows as bad. I really need this to be fixed or I might have to gut it. Would prefer not to do that. The DNS thing above wasn't the issue, nothing has been fixed. Picandnix follow the link to blackwidowarms.com and then click on a link in the site and you'll see what I mean.....

29 Jul 2014, 11:16 PM
#12
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Wrong URL...

micro007:

Well I thought I was done but it has not worked and the URL still shows as bad. I really need this to be fixed or I might have to gut it. Would prefer not to do that. The DNS thing above wasn't the issue, nothing has been fixed. Picandnix follow the link to blackwidowarms.com and then click on a link in the site and you'll see what I mean.....

That issue seems to possibly something in your configure.php or if you have another uri rewriter. Every link goes somewhere "unexpected" and I thought that those links are generated off of the ZC code, so the redirect gets there, but then tries to send you off somewhere else. :/

30 Jul 2014, 1:23 PM
#13
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Wrong URL...

micro007:

I basically installed Zen Cart on the server added a couple of addons and redid the graphics. Configured all the necessary files per the template instructions and added HTML redirects to point to the sub-domain of the parent directory which is setup through the CP Panel of my hosting company.

If you've set up the domain correctly there will be no need for any redirects. Redirects are bad, m'ok.

micro007:

So I have an HTML Redirect and a CP Panel URL redirect that dumps you right from http://www.blackwidowarms.com to https://store.blackwidowarms.com this works perfectly in all browsers. I've ensured that the configure.php is as follows -

A redirected redirect. Doesn't get much messier than that. I dread the day you decide that 'SEO rewrites' are a good thing.

micro007:

define('HTTP_SERVER', 'http://store.blackwidowarms.com');
define('HTTPS_SERVER', 'https://store.blackwidowarms.com');

define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');

define('DIR_FS_CATALOG', '/home/content/**/*******/html/store/');


Is this the same in *both* of the configure.php files?    I'm guessing that one of them still holds the data for bangorang.com
 
> **micro007:**
>
> If you get to <https://store.blackwidowarms.com> from anywhere then click on a link within the website it takes you to my main account domain and then mydomain.com/store which is where the files for zen cart sit. No secured link or anything. I've talked to the hosting company and they have no clue! Please tell me I don't have to gut and start over.... everything works and things can be ordered. My entire domain has a SSL cert so I'm not worried about that. I just need the links to show his business! I haven't done too much database programming but I can get in there if anyone thinks that this might be where the problems is. Any help would be appreciated.....

This will have nothing to do with the Database.  It is a configuration issue that has been compounded by having a redirect where its not needed (cpanel) plus one or more other redirects (also probably not needed) that have been put in place (I assume) to try to overcome the problem with the zencart configure.php settings.  

A correctly configured website (zencart or otherwise) has no need for a redirect at any time.  These things (redirects) should only be used for their intended purpose, which is to *redirect* the URL of an *original* website to the *equivalent* URL of a relocated website (such as if/when the original site has been relocated to a different domain.  If you get rid of all of your redirects and set the DNS and Website up without using them, you'll find most, if not all of your problems will simply vanish.  

Redirects are bad, m'ok. 

Cheers
RodG
31 Jul 2014, 7:14 PM
#14
micro007 avatar

micro007

New Zenner

Join Date:
Jan 2008
Posts:
43
Plugin Contributions:
0

Re: Wrong URL...

Okay, if I'm understanding you correctly, my problem is with the redirects? The site name is registered with another company and points to my server. I have all of my hosted domains sitting under my main domain. When I built the store I built it in the store directory under the main domain directory so I could make sure it was secure before going live. It was not built in the blackwidowarms directory. So, I used a redirect from the blackwidowarms directory to the store directory when it went live. The redirects do exactly what their suppose to do....

It's when you get there and click on something and it changes the url in the browser to read maindomain/store.....

Have I done this wrong? It worked on the last site I built.... I understand I might be wrong and really would appreciate any continued help.

31 Jul 2014, 8:31 PM
#15
micro007 avatar

micro007

New Zenner

Join Date:
Jan 2008
Posts:
43
Plugin Contributions:
0

Re: Wrong URL...

micro007:

Okay, if I'm understanding you correctly, my problem is with the redirects? The site name is registered with another company and points to my server. I have all of my hosted domains sitting under my main domain. When I built the store I built it in the store directory under the main domain directory so I could make sure it was secure before going live. It was not built in the blackwidowarms directory. So, I used a redirect from the blackwidowarms directory to the store directory when it went live. The redirects do exactly what their suppose to do....

It's when you get there and click on something and it changes the url in the browser to read maindomain/store.....

Have I done this wrong? It worked on the last site I built.... I understand I might be wrong and really would appreciate any continued help.

Since the above I found another configure file in the admin directory that had maindomain.com in it. Changed it but it still shows wrong is there a cache I need to dump or something. I deleted browser history but ti still is coming back as maindomain.com/store.....

1 Aug 2014, 9:07 AM
#16
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Wrong URL...

micro007:

Since the above I found another configure file in the admin directory that had maindomain.com in it. Changed it but it still shows wrong is there a cache I need to dump or something. I deleted browser history but ti still is coming back as maindomain.com/store.....

Must be a cache issue. When I go to blackwidowarms.com I'm ending up on http://store . blackwidowarms . com/

Is that what you are after, or do you want it to appear as http://blackwidowarms . com/ or perhaps http://www . blackwidowarms . com/ ?

Cheers
RodG

1 Aug 2014, 9:54 AM
#17
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Wrong URL...

micro007:

Okay, if I'm understanding you correctly, my problem is with the redirects?

Yes, it could be due to redirects, but no, you didn't quite understand what I was trying to tell you.

The point I was trying to make is that you are needlessly using redirects and that can only complicate matters for you. It's like putting up several detours where none are needed. At the end of the day if all the detours are correct you'll eventually end up at the correct destination, but it is far better to take the more direct route.

micro007:

The site name is registered with another company and points to my server.
This is essentially true of nearly all websites. The only exceptions are if the domain registrars also provide hosting services (many don't). On the flip side, most web hosts will also provide registration services but only by registering the domains on the clients behalf with an ICANN accredited registrar.
There are many 1000's (perhaps millions) of 'Webhosts' out there, but the number of registrars can be counted in the hundreds.

micro007:

I have all of my hosted domains sitting under my main domain.

I understand what you are saying, but this technically isn't the case. What you have is all of your domains managed by a single user account. A user account and a domain name are not the same thing, but most hosts tend to muddy the waters a little by assigning the 1st domain name setup as being the account name.

micro007:

When I built the store I built it in the store directory under the main domain directory so I could make sure it was secure before going live. It was not built in the blackwidowarms directory. So, I used a redirect from the blackwidowarms directory to the store directory when it went live. The redirects do exactly what their suppose to do....

That will work (as you know), but a far better way of achieving the desired results WITHOUT having to use a redirect would be to set the Document Root of any given domain to match where the site files actually reside.
IOW, if you have somedomain.com having its document root at /filepath/filepath/public_html/ and you develop the site by placing the files in /filepath/filepath/public_html/store/ and later decide you want people to find the site at "somedomain.com" instead of "somedomain.com/store" instead of doing a redirect, just change the document root for somedomain.com from /filepath/filepath/public_html/ to /filepath/filepath/public_html/store/ and you'll acheive the same results without having to redirect the browser.
Not only do redirects complicate matters in regards to where the client finally ends up, they also come at a performance cost as the customers web browser has to 'navigate' the redirects.
Redirected sites also tend to get lower search engine rankings.

micro007:

It's when you get there and click on something and it changes the url in the browser to read maindomain/store.....

This will be because ZenCart creates the URL's dynamically, based on the settings in its configuration.php files. There are two of these files, one for the store itself, the other for the admin section of the store.

micro007:

Have I done this wrong? It worked on the last siteI built.... I understand I might be wrong and really would appreciate any continued help.

I won't go as far to say that you've done it wrong, after all, if it works, then by definition it must be right. It's just that like most things relating to computers there are often many ways of achieving the same end results. It is just that the redirect method is quite inefficient (compared to ending up at the same place without using redirects), and if you then start redirecting something that has already been redirected it is far too easy to make mistakes and causing endless loops (redirect on site 'A' points to site 'B' that redirects back to site 'A' ad infinatum).

Hopefully this has helped clarify rather than confuse, but if I have managed to confuse you, then please feel free to ignore all of this and just do what works for you. You are not alone in jumping onto the 'redirect solution' rather than the document root solution, in fact you are quite probably one of the majority. However, if you want further clarification about any of this don't be afraid to ask.

Cheers
RodG