cancel
Showing results for 
Search instead for 
Did you mean: 

Switch 2.4 magento domaine name

Switch 2.4 magento domaine name

Hello, I hope you are feeling good. I have a relatively quick question. My Magento 2.4 server is working well. It is configured to run on the server IP and it has no domain name  yet. 
I would like to know how to change the config so that everything runs on the domain name instead.

 

I know it is possible to go and change the base secure/unsecure URL. It does change the default URL but what I would like to know is how to configure Nginx and Magento to use the domain name. Right now, even if the default URL uses the domain, it is not configured properly. 

 

What is the complete steps I should take? 

 

I believe I might need to go in my Nginx sites-enables folder and  change the server-name.

I believe I might need to go in magenta 2.4 config to switch the base URL.

My domain name DNS is already pointed to my web server IP.

 

Do I need to do anything else for the website to run properly with my domain name? Thank you

4 REPLIES 4

Re: Switch 2.4 magento domaine name

@francisrivddb4That is all needed.

 

 

Point DNS to your hosting server. This may take up to 24 - 48 hours. Depending on TTL you have.

Have domain configured in your webserver - Nginx/Apache.

Have Magento configured with the same URL.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: Switch 2.4 magento domaine name

Ok thanks, I tried but It doesn't work. Should I be able to access the website by the ip too? I believe that yes, when I do it says: 

403 Forbidden
nginx/1.18.0 (Ubuntu)

Could it be permission error?  I tried 

cd <your Magento install dir>
find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \;
find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \;
chmod u+x bin/magento
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flushStill 
403 Forbidden
nginx/1.18.0 (Ubuntu) when I try to access by ip. Should the host name contains my domain and ip?

Re: Switch 2.4 magento domaine name

Been trying couple of things, now when I access my domain, or web server IP I get 
"An error has happened during application run. See exception log for details." Am I getting closer to get it to work? How would I proceed from there?

Re: Switch 2.4 magento domaine name

 

The key steps to switch Magento from IP to domain name are:

  • Update Nginx server_name
    Change Magento base URLs in the admin
    Update core_config_data base URLs
    Flush caches and reindex
    Update hardcoded IP references
    Test site functionality thoroughly