CSS not being applied on the production server

My site is working fine on localhost using XAMPP. However, when I move all files to the production server I get issues displaying it properly - it’s missing styling and all images that are referenced are not showing up.

When I look in the dev console, I see the following:

A string of digits are being appended to the file name and indeed, no such file exists as shown below:

image

Any idea what’s going on?

Have you uploaded the media folder? If so, delete it from the remote server.

Regarding those assets, looks to me as if you are using some fingerprinting that adds timestamps?

How do you include these assets in your header?

I am simply copying over what works on local (XAMPP) to remote (a linux VPS with PHP and the necessary php-mods).

I am using WinSCP to do the transfer and at first I though that is what was messing with the file names. So far, I have also tried deploying with Rsync and pulling the project in to the server as a cloned repo. All these techniques result in the same mangled file name.

When I remove the digits, I can see the expected file in the browser, so something is adding numbers to the files.

I have narrowed down the issue to the Cachebuster plugin. It’s the one adding the string of digits (timestamps) to the css and js files. The problem is that when it does so, my server can’t find the timestamped file for some reason even though it exists and I can see it in dev-tools.

I have turned off Cachebuster for now and my site is loading properly with style and structure.

A remaining issue though is that images that are used on the wesbite and contained in the ‘media’ folder are not showing. I removed the media folder, but how do I get the images that are part of my project to show?

That’s what I meant with fingerprinting.

Was the media folder recreated after you removed it? Are there any files in it now?

Does the rest of the site work, e.g. subpages (if there are any)?

The media folder was created I after i removed it, but it contains no files in it.

The rest of the site does not work - links to subpages are not working.

Okay, I’ve fixed this issue - I just needed to do one more step and that was to set the .htaccess to be picked up.

My site is fully working now and I will sort out cachebuster later.

Thanks for your help.

That would have been my next question :wink:

I guess the missing rewrite rules are also the reason why cachebusting didn’t work.

I just want to confirm that this may have been the case as cachebusting is also working now.