Forums / Basic Configuration / Styles gone after editing config file

Styles gone after editing config file

Views: 3,132

Results 1 to 20 of 28
27 May 2011, 9:38 PM
#1
aself avatar

aself

New Zenner

Join Date:
Feb 2011
Posts:
29
Plugin Contributions:
0

Styles gone after editing config file

I'm trying to edit my config files after changing nameservers. When I changed from

 define('HTTP_SERVER', 'http://[I]myusername.hostname[/I].com');
 define('HTTPS_SERVER', 'http://[I]myusername.hostname[/I].com');

to

 define('HTTP_SERVER', 'http://[I]www.mydomain.com[/I]');
 define('HTTPS_SERVER', 'http://[I]www.mydomain.com[/I]');

I lose my styles. Also, the links within the unstyled page return 404 errors.

I also cannot access my admin login page.

Thanks for any help!

27 May 2011, 9:57 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Styles gone after editing config file

Mark, they said they changed nameservers, not "servers". Granted, some people throw around the term "nameservers" without knowing what they're really saying.

I suspect the problem is twofold:
a) If there has in fact been a change made to nameserver settings, then replication hasn't completed yet. Can take up to 48 hours.
b) In addition to altering HTTP_SERVER settings sometimes it's necessary to alter DIR_WS_CATALOG and/or DIR_FS_CATALOG. It really depends on the big picture of what's really changed technically regarding paths.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

27 May 2011, 10:10 PM
#4
aself avatar

aself

New Zenner

Join Date:
Feb 2011
Posts:
29
Plugin Contributions:
0

Re: Styles gone after editing config file

Thank you both for responding. I did in fact mean nameservers, although it IS new to me :smile:. My domain is hosted at a different host and previously, I just used a redirect. I'm just getting my security certificate and needed to change the nameservers which I did about 8 days ago. A lot seems to have happened when I did that. The problems I've listed are the ones I could wrap my head around to start with.

Regarding b) from DrByte, I didn't change any paths on purpose but I understand there were changes and I need to learn how to fix them now.

28 May 2011, 2:13 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Styles gone after editing config file

Perhaps you can explain the bigger picture about why you're changing what you're changing?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

28 May 2011, 7:18 PM
#6
aself avatar

aself

New Zenner

Join Date:
Feb 2011
Posts:
29
Plugin Contributions:
0

Re: Styles gone after editing config file

Ok, the long story is that I had a site and domain at one host. I didn't like the interface at that host and was redesigning the site and adding a shopping cart (ZC). Therefore, I built the site at a new host but left the old one up until the new one was finished. When it was done, all I did was point (terminology?) the domain to the new site. At this point, the domain is at the original host and the files are at the new host. I can tell you that at this stage when you went to any page on my site the URL was https://www.mydomain.com and when I refreshed any page it always went back to the index page. Hopefully that describes what I did with the domain pointing.

I had the product page basically disabled at this time and just bought a security certificate. To do so, I had to change the nameservers where the domain is to properly go to my new site. When I did that and after 48 hours I couldn't access my site with https://www.mydomain.com but figured out that I could with https://www.mydomain.com/CUSTOM/index.php. I called my host and they changed a few things and got that to work. However, I can't access my admin login page (404 error) and can't figure out what to change the config files to. Which brings me back to my first post.

Thank you so much for your patience in reading my posts. I don't know how else to fix this :(

Andrea

28 May 2011, 7:22 PM
#7
aself avatar

aself

New Zenner

Join Date:
Feb 2011
Posts:
29
Plugin Contributions:
0

Re: Styles gone after editing config file

Oh! Also, right now I can access my site with https://www.mydomain.com but when I click any link in my site the URL is myname.hostname.com/page/etc. which is the address I was using while building the site. Thanks!

28 May 2011, 7:54 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Styles gone after editing config file

configure.php file contents explained: https://www.zen-cart.com/tutorials/index.php?article=408

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

28 May 2011, 8:48 PM
#9
aself avatar

aself

New Zenner

Join Date:
Feb 2011
Posts:
29
Plugin Contributions:
0

Re: Styles gone after editing config file

Thanks again DrByte. I think I understand these settings from your explanation and the site comes up fine when I enter www.my_domain.com but then the old URL's show up when I go to different pages. When I change HTTP_SERVER and HTTPS_SERVER to the domain name instead of my original temporary URL, my styles are gone and when I click on links to pages in the non-styled page, I get 404 errors.

I'm thinking I may have to do a fresh install but resist because I'm not confident in my ability to get the template working just right again.

Thanks for still helping.

29 May 2011, 12:16 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Styles gone after editing config file

What exactly ARE those bad links in the non-styled pages?
How exactly do they differ from the supposed "good" URL?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

29 May 2011, 1:17 AM
#11
aself avatar

aself

New Zenner

Join Date:
Feb 2011
Posts:
29
Plugin Contributions:
0

Re: Styles gone after editing config file

Well, my "Sign In" link (i.e. c l e a r a i r a z .com/products/index.php?main_page=login), or my EZ-pages links come up with 404 errors if I change HTTP_SERVER to www.my_domain.com instead of the URL I was using to build the site. Again, there is no styling (or template I guess) either when I make this change.

Thanks again.

29 May 2011, 3:46 AM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Styles gone after editing config file

Apparently your "http://www.c l e a r a i r a z .com" site is pointing directly to the /products/ folder, since going to "http://www.c l e a r a i r a z .com/index.php?main_page=login" works just fine

So, you need to set HTTP_SERVER to "http://www.c l e a r a i r a z .com" (without the spaces of course)
and your DIR_WS_CATALOG to '/' instead of '/products/'

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

29 May 2011, 6:49 PM
#13
aself avatar

aself

New Zenner

Join Date:
Feb 2011
Posts:
29
Plugin Contributions:
0

Re: Styles gone after editing config file

You're right, it is pointed there. I tried removing the pointer and leaving DIR_WS_CATALOG to '/products/' but got the host's "Site under construction" page. Then I pointed it back to the /products/ folder and set HTTP_SERVER to "http://www.c l e a r a i r a z .com" (without the spaces of course)
and DIR_WS_CATALOG to '/' instead of '/products/'

The URL's are working properly now but all of my images are gone. Can this be unscrambled? Remember, it worked perfectly with the temporary URL. The only change I made was to the nameservers. Haha, ONLY change.

30 May 2011, 3:55 AM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Styles gone after editing config file

As of right now your configure.php still points to your startlogic URL. It's really hard to diagnose anything when you keep changing it back.

When your images suddenly disappear, use View Source in your browser to look at the generated <base href> tag and see what URL it points to. If it still points to the old URL or if clicking any links goes to the old URL, then your changes aren't being entered properly. The <base href> and the various <a href> links shown will give clues to what's wrong.
But if I can't see them, I can't help you.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

30 May 2011, 6:22 AM
#15
aself avatar

aself

New Zenner

Join Date:
Feb 2011
Posts:
29
Plugin Contributions:
0

Re: Styles gone after editing config file

I'm so sorry! I didn't realize what I was doing to hinder your help. The problem is that this site is live so I'm checking it, then changing it back to what works (other than the URL showing the problems). Please forgive the unprofessionalism but I have learned a great deal by doing this site and this was the understanding with the client who gave me this opportunity.

I can send a text file to you with configure.php copied and pasted along with the source for HTTP_SERVER set to "http://www.c l e a r a i r a z .com" (without the spaces of course)
and DIR_WS_CATALOG to '/' instead of '/products/'. Then another file with configure.php copied and pasted along with the source for HTTP_SERVER set to "http://name.hostname.com"
and DIR_WS_CATALOG to '/products/'. OR I can post them here. Would that be helpful? Is there anything I should block out other than the DB name and pwd?

30 May 2011, 6:31 AM
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Styles gone after editing config file

Sure. Just the DB name and pwd need to be blacked out. You can PM me with a link to download the files if you don't want to post the content publicly.

aself:

You're right, it is pointed there. I tried removing the pointer .... Then I pointed it back ...
What do you mean by "pointed"? Are you just referring to the DIR_WS_CATALOG setting? Or to a domain configuration (vhost etc) in your hosting account? Or are you moving the folder around on your server?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

31 May 2011, 2:03 AM
#17
aself avatar

aself

New Zenner

Join Date:
Feb 2011
Posts:
29
Plugin Contributions:
0

Re: Styles gone after editing config file

What do you mean by "pointed"? Are you just referring to the DIR_WS_CATALOG setting? Or to a domain configuration (vhost etc) in your hosting account? Or are you moving the folder around on your server?
This is a domain configuration. Here's a screenshot: Attachment #9322

Also I haven't ever moved the files. I'll send links to the files since I included everything and they're big. Thanks so much.

31 May 2011, 4:00 AM
#18
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Styles gone after editing config file

Okay, so if you've "pointed" the domain to the public_html/products folder (a practice I don't normally recommend), then your DIR_WS_CATALOG needs to be set to '/' and your DIR_FS_CATALOG needs to end in 'public_html/products/' (but I can't tell what the first half of it is, since that's specific to your server. The key is after the public_html it still needs /products/ because that's what you've pointed the domain to) ... it should already have that, so likely won't need to be touched.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

31 May 2011, 11:04 PM
#19
aself avatar

aself

New Zenner

Join Date:
Feb 2011
Posts:
29
Plugin Contributions:
0

Re: Styles gone after editing config file

I would also like to NOT "point" the domain to the public_html/products folder if we can figure this out. I checked DIR_FS_CATALOG and it ends in 'public_html/products/'.

Here are the rest of the scenario's including image info from "View Source" where applicable:

  1. Domain “pointed” to “/products”

define('HTTP_SERVER', 'http://michelw.startlogic.com');
define('HTTPS_SERVER', 'http://michelw.startlogic.com');

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

Result: https://www.clearairaz.com works but URL’s return to michelw.startlogic.com
michelw.startlogic.com returns host’s “This site is under development” page

Images

<base href="http://michelw.startlogic.com/products/" /> src="includes/templates/pure_blue/images/clear-air-logo-TEL.png" - **works** src="/products/includes/templates/pure_blue/images/IQAir.gif" -** works**
  1. Domain “pointed” to “/products”

define('HTTP_SERVER', 'http://michelw.startlogic.com');
define('HTTPS_SERVER', 'http://michelw.startlogic.com');

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

Result: https://www.clearairaz.com “works” but no styles/template and links on page return “Page not found”.
michelw.startlogic.com returns host’s “This site is under development” page

  1. Domain “pointed” to “/products”

define('HTTP_SERVER', 'http://www.clearairaz.com');
define('HTTPS_SERVER', 'http://www.clearairaz.com');

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

Result: https://www.clearairaz.com works but half of the images display alt title. Links to other pages display correct URLs.
michelw.startlogic.com returns host’s “This site is under development” page

Images

<base href="http://www.clearairaz.com/" /> src="includes/templates/pure_blue/images/clear-air-logo-TEL.png" - **works** src="/products/includes/templates/pure_blue/images/IQAir.gif" - **displays alt title**
  1. Domain “pointed” to “/products”

define('HTTP_SERVER', 'http://www.clearairaz.com');
define('HTTPS_SERVER', 'http://www.clearairaz.com');

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

Result: https://www.clearairaz.com “works” but no styles/template.
michelw.startlogic.com returns host’s “This site is under development” page

  1. Domain “pointed” to home directory (or “/”)

define('HTTP_SERVER', 'http://michelw.startlogic.com');
define('HTTPS_SERVER', 'http://michelw.startlogic.com');

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

Result: https://www.clearairaz.com returns host’s “This site is under development” page
michelw.startlogic.com returns host’s “This site is under development” page

  1. Domain “pointed” to home directory (or “/”)

define('HTTP_SERVER', 'http://www.clearairaz.com');
define('HTTPS_SERVER', 'http://www.clearairaz.com');

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

Result: https://www.clearairaz.com returns host’s “This site is under development” page
michelw.startlogic.com returns host’s “This site is under development” page

  1. Domain “pointed” to home directory (or “/”)

define('HTTP_SERVER', 'http://michelw.startlogic.com');
define('HTTPS_SERVER', 'http://michelw.startlogic.com');

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

Result: https://www.clearairaz.com returns host’s “This site is under development” page
michelw.startlogic.com returns host’s “This site is under development” page

  1. Domain “pointed” to home directory (or “/”)

define('HTTP_SERVER', 'http:// www.clearairaz.com');
define('HTTPS_SERVER', 'http:// www.clearairaz.com');

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

Result: https://www.clearairaz.com returns host’s “This site is under development” page
michelw.startlogic.com returns host’s “This site is under development” page

I can see some of the patterns here, but wanted to show it to you first. I can see why #3 works (mostly:)) but #8 seems ideal but doesn't work. I don't understand that one. Hopefully this provides some clues. As always, thank you!

2 Jun 2011, 7:36 AM
#20
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Styles gone after editing config file

#8 is what I'd be recommending to use.
It's unclear why the server is rejecting that though.
You'd need to see the server's apache error_log to see why it's throwing a 404 (or whatever) error.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.