Cannot change the base url
-
16-10-2019 - |
Question
I am trying to change my store base URL but it's not working.
Currently the base URL is set to my installation dir http://ns999999.ovh.net/magento/
I'd like to change it to a domain's name such as http://www.my_domain_name.com/ (which is redirected towards current_base_URL/index.php/)
When I do the change, I get blank pages, both for admin and front-end. I did clear the var/cache and var session directories.
Can someone help me resolving this issue ? Any help would be greatly appreciated.
Solution 3
I resolved my problem by creating a Virtual Host on my server handling the redirection, instead of using my host's redirection utility.
In the Virual Host definition, it's important to replace
AllowOverride None
with
AllowOverride All
so that the .htaccess file is used and /index.php can be removed from the links.
OTHER TIPS
Site relocation issues:
forgetting the trailing slash on the baseURLs,
changing the rewritebase in .htaccess
check file/folder permissions and change so server can write to the directory tree especially
var/
andmedia/
app/etc/local.xml changes so Magento can access the new database
After fixing these things, then clear cache.
You need to change the base url, the https base url, and the cookie url. If you are managing multiple store views you'll need to change the urls for each of those as well.
To find (and possibly update) all config settings using the old URL, run the following query against your db:
SELECT * FROM core_config_data WHERE value LIKE '%ovh.net%';
This will return all values which contain that domain. You should update all affected config paths.
If the "white screen" problem persists it means that an error is occurring - you should follow the standard debugging process.
While you transfer files to from server to other, normally, the .htaccess file doesnt get copied. So, just copy the .htaccess file and upload to your new hosting root folder and thats it.
Then goto your database and check the core_config_data table. You will see columns like web/unsecure/base_url and web/secure/base_url . Edit them and make sure, those 2 are pointing to your new domain.