Site not working after transfer to new host

I have a working Modx 2.8.1 site that I am moving to a new webhost. I copied all the files and the database. Ran the setup program successfully in advance mode. The website homepage will load but with no CSS and no images. All links to lower pages result in a 404 error. I can also login to the manager, but I get a mostly blank page. Only the top menu bar and the Modx News Feed and Modx Security Feed with a spinning circle and “loading”. No site content displays.

Best I can tell. file privileges are correct. I also checked and compress_css and compress_js are both set to 0.

When I look at the page source for my home page I see the following in the header:

<base href="http://www.graylineinc.com." />
<link rel="stylesheet" href=".assets/templates/grayline/css/base.css" type="text/css" media="screen, print" />

My header chuck that produces these lines is:

<base href="[[++site_url]]" />
<link rel="stylesheet" href="[[++base_url]]assets/templates/grayline/css/base.css" type="text/css" media="screen,print" />

I’m not sure if this is correct. I don’t understand the “.” at the end of graylineinc.com and at the beginning of assests. Can anyone point me to a fix?

Is it possible that you have typed that trailing period into the siteurl setting?

Check the values in the file core/config/config.inc.php.

Not sure where that would be. According to Modx: The Official Guide, “The value of site_url is not available in the System Settings grid. It is set automatically by Modx based on the URL the user entered the site through”.

@Lucy is correct. You do have the trailing period on your page.

You also have a period preceding the path to your css file, so it reads.
http://www.grayline.com./.assets/templates/grayline/css/base.css

But if you remove that period and try to access your CSS file there is an error that looks like it is permissions related.

http://www.grayline.com/assets/templates/grayline/css/base.css

<Error>

AccessDenied
Access Denied
F241D568480707EF

E5nQc+ct9UGTuoXdR65DZHlq8Mb58GALw0REMfnCwtFvQWFKVg5O+LCDeK/ZEgAeeofGgPz61LI=

Yes sorry, was thinking of the context settings. Might just check what is set for web context.

If you have this in your /core/config/config.inc.php
$modx_base_url= '/';

Then you should be able to use this in your template header
<base href="[[!++site_url]]" />

Ok, I did find an error in config.inc.php. There was a . instead of / for the base-url. I corrected that.
Now, Manager works again and the home page loads with images but still no CSS and no lower pages work. I can go directly to the css file.

That’s interesting. I’m still getting the XML error page if I try to access
https://www.grayline.com/assets/templates/grayline/css/base.css

I see the site uses Cloudflare. Could there be an issue with that?

Apologies. I see that half way through looking at this problem I have mis-typed the url, leaving out the inc part of it. So some of my comments are irrelevant.

I opened my homepage in Firefox and opened the Web Console. I can see there is a GET for the CSS which returns OK 200. However, the next line shows an error: The stylesheet http://www.graylineinc.com/assets/templates/grayline/css/base.css was not loaded because its MIME type, “text/html”, is not “text/css”.

I think this may be related to some of your content trying to load as http, when the site is defaulting to https.

There seem to be many reasons why the wrong MIME type could be associated with your css file.
You could try removing the @charset "utf-8"; line from the start of your css file since it’s not necessary anyway.
And in your html template maybe move the content meta tag and baseurl tag to the top – right now you have title tag above those.
Is this apache or nginx? I would check htaccess or web rules to see if anything jumps out as not standard…

thanks everyone. I found the problem. There was a special .htaccess file in the CSS directory that was needed for the old webhost. apparently the new host didn’t like that. Once I deleted it, my site started working again.

Now that you have it sorted, be sure the base href line in all your templates has the exclamation point, as andytough suggests. It will avoid some potential future problems.