There may be an occasion where you must change the URL for PrestaShop installation because it's simply moving from one folder to another on the same server. This means that the database would remain in the same location, but the files would all shift to a different location on the server. The following article explains how to make the URL change within the OpenCart 1.5 database.
Modifying the Website Address after moving the Prestashop Installation Location
In order to make this change you will need to have access to your PrestaShop backoffice or the database. You will also need to know the new address that you will be using for the change. The changes will be shown with the Cpanel File Manager, the Administrator Dashboard and the PhpMyAdmin.
- Login to the Cpanel of the server where the OpenCart installation is located
- Use the File Manager to move the files into the PUBLIC_HTML or other location as needed. The following screenshot explains the file movement using the FILE MANAGER:
The screenshot above explains that the files and folders within the current location of the PrestaShop installation are within the "prestashop152" folder. For purposes of this article, the all of these files and folders are being moved to the PUBLIC_HTML folder (one level above the current location).
- To move the files in File Manager, you go into the prestashop152 folder, select all the files within the folder, then at the top left of the menu bar for the file manager you would select MOVE FILES. A small window will appear asking you where to move the files. You would change the destination path to simply /public_html/. Then click to proceed with the move.
The easiest way to make URL changes is to actually login to he Administrator Dashboard and then go to the SEOS and URLs section. Here are some quick steps to help your entry:
- Login to the Administrator Dashboard
- Hover over the menu bar where it reads PREFERENCES, then click on SEOs and URLs when it appears in the drop-down menu
- Scroll down until you can see SET SHOP URL
- Once you have completed making your changes, please click on the green SAVE button in the top right hand corner.
You can also make these changes directly in the databases. The following steps take you through making these changes directly through the database program called PHPMYADMIN.
Once the files have been moved, the next major step is to make the change in the database. To edit the database, you will need to go into PHPMYADMIN. This application is found under the Database section of the Cpanel. Open the application by double-clicking on it in Cpanel.
- Once you have entered it you will need to select the database to be edited. The screen will sort of like this, but database names on all elements. To protect the security of the server, names have been altered in this example:
Select the database you wish to change and then proceed to the next step.
- Once you have selected database (by clicking on the database as highlighted above), you will see something similar to the following:
Select the ps_shop_url by clicking it once, and you will see the following.
- Click on EDIT to change the entries. In this example, the new URL will be example.com. You will need to add to both the DOMAIN and the DOMAIN_SSL entries. You will also need to change the physical_uri to /public_html/ (if you have installed evrything to the root ). Changes will look like this:
This completes the change for the shop URL as made directly in the database.
Changing the URL for website is a quick process when using the built-in interface, but it can also be done directly in the database if necessary. Note that changes affect the operation of the software and should only be changed as necessary. There may sometimes be issues with the URL for the shop after this type of change. If FRIENDLY URLS (located on the same page of the Administrator dashboard as the shop URL changes described in this article) were previously set, you may need to turn this function off and save the change. Then turn it back on again after checking to make sure that the website pages were operating correctly.