When you have just moved your Prestashop installation – most likely because you’re doing some development – you might be unpleasantly surprised when you try to visit the site. Where did all my CSS go? My site was so pretty, and now it looks like text and blue links!
That, my friend, is because you need to fix the domain and physical URL for the site. Otherwise, your installation will be looking for your CSS files (which make your site pretty) in the wrong location.
Changing the URL
The easiest way to change your Prestashop URL is also the one that isn’t an option right now; using the Prestashop backend. Good luck trying to navigate your Admin panel right now.
Instead, an equally simple method of fixing the problem, is changing two values in your database. If you’ve got access to your database, this is the quick fix.
How it is done
- Open the database, using your SQL tool of choice (PHPMyadmin, Sequel Pro, Toad for MySQL or Navicat. I’m not judging).
- Navigate to the table ps_shop_url (where PS is the database prefix you chose)
- Go to the “domain” value, and edit it to your current domain name. That’s the domain name, without subfolder. E.G if your shop is on mytestdomain.com/stuff/apps/ enter mytestdomain.com
- When you’ve moved Prestashop to a subfolder (or were using a subfolder), edit the “Physical URL” value. Set it to / if you’re not using a subfolder. Add the subfolder(s) if you were. E.G if your URL is mytestdomain.com/stuff/ change the value to /stuff
- Depending on your tool you’re using, the change is now saved. Return to your Prestashop installation, and refresh the page. You’ll see that the CSS now loads.
Mission accomplished. We did it, guys (and girls)!