• Please advise how to change the URL of a website

    From;
    https://domain.com/domain/
    To:
    https://domain.com

    I have tried follows without use (fail);

    1)
    Edit wp-config.php
    Change from:
    define( ‘WP_SITEURL’, ‘domain.com/domain/’ );
    To:
    define( ‘WP_SITEURL’, ‘domain.com/’ );

    Also
    2)
    Settings -> General
    WordPress Address (URL) https://domain.com/domain/
    grey out, I can’t change it

    Site Address (URL)
    I can change it but no use

    Thanks in advance

    • This topic was modified 1 year, 4 months ago by satimis.

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Settings -> General
    WordPress Address (URL) https://domain.com/domain/
    grey out, I can’t change it

    That’s because you have the URLs defined in wp-config.php.

    Note that, by default, no URL is defined in wp-config.php, which makes the two addresses editable in the dashboard. Once defined in the wp-config.php file, the dashboard fields get locked out.

    Note also that there are 2 constants/URLs to change, not just one: WP_HOME (WordPress Address) and WP_SITEURL (Site Address). And there are several ways to change the URLs

    1) Define BOTH constants in your wp-config.php file. Be sure to include full URLs, and include the protocol (http/https).

    2) Remove any URL definition from wp-config.php, so you can change them in the dashboard

    3) Add code to your active theme’s functions.php file to update the database. If you go this route, be sure to remove the code afterwards

    4) Change the URLs directly in the database table

    Whichever route you take, if this is an established site, you’ll need to also do a full search-and-replace on the database to change the URLs of all uploaded media files.

    Please see the official support article for details: https://www.ads-software.com/documentation/article/changing-the-site-url/

    It’s me again ??

    Sorry, I missed an important detail in your question: you’re switching from a subdirectory to the root domain.

    There are two possibilities to consider:

    OPTION 1) If you want everything to run from the root domain… ie both the URLs of your site’s pages (defined by Site address or WP_SITEURL constant) and WordPress URLs (dashboard, uploads, etc, defined by WordPress Address or WP_HOME constant)… then, in addition to the normal process outlined above, you’ll need to also MOVE all the files and folders inside the reynoldstocks subdirectory to the root directory.

    OPTION 2) If you want to ONLY have the URLs of your site’s pages at the root, but keep all the WordPress stuff in a subdomain, then ignore my earlier post above and kindly follow this support article instead: https://www.ads-software.com/documentation/article/giving-wordpress-its-own-directory/

    Thread Starter satimis

    (@satimis)

    Hi George,

    Thanks for your advice.

    The site is installed on /public_htm/domain/. All files are there.

    The site was installed/migraged on Duplicator packages. I expect running the site on its own folder, not on root. There are 36 sites running on cPanel.

    Regards

    • This reply was modified 1 year, 4 months ago by satimis.
    • This reply was modified 1 year, 4 months ago by satimis.
    • This reply was modified 1 year, 4 months ago by satimis.

    I expect running the site on its own folder, not on root.

    Then follow OPTION 2 outlined above. The documentation page provided should tell you everything you need to do.

    Thread Starter satimis

    (@satimis)

    Whether to follow
    Method II (With URL change) Moving process
    of OPTION 2
    ?

    Thread Starter satimis

    (@satimis)

    Thanks. I’ll go through the document later.

    But I couldn’t resolve why encountering this problem. I have 36 sites running on cPanel of Hostgator server without URL problem. In recent days Hostgator has changed a new cPanel making me encountering this problem.

    Regards

    But I couldn’t resolve why encountering this problem. I have 36 sites running on cPanel of Hostgator server without URL problem.

    Your question was about “how to change the URL of a website” from example.com/subdomain to example.com. Did you change the URLs the same way for ALL these 36 sites you mentioned?

    In recent days Hostgator has changed a new cPanel making me encountering this problem.

    I’m not familiar with Hostgator, what features you have in your Hostgator cPanel, or what changes they introduced in their new cPanel software. So, unfortunately, I can’t comment on that.

    Thread Starter satimis

    (@satimis)

    All other 36 sites have been running for several years. According to my recollection I just installed WordPress and selected the domain. It created a new website folder and installed WordPress on the folder simultaneously. Now I have to create the folder manually otherwise WordPress will be installed on root.

    Besides this is NOT my first time migrating website running Duplicator packages. All live sites have cloned sites running on local server. They are not open to public. Should the live sites having problem I just migrate the cloned site to the cPanel of the server.

    • This reply was modified 1 year, 4 months ago by satimis.
    Thread Starter satimis

    (@satimis)

    Hi George,

    I got my problem solved by HostGator Support. They created a redicection for this site.

    URL https://reynoldstocks.com

    Waiting a while it redirects to https://reynoldstocks.com/reynoldstocks/

    I can’t change the URL unless moving all core files to root. I’ll use this redirection for time being until having time to reinstall this website.

    Anyway lot of thanks for your assistance.

    Regards

    • This reply was modified 1 year, 4 months ago by satimis.

    Thanks for your advice.

    OPTION 1)?If you want everything to run from the root domain… ie both the URLs of your site’s pages (defined by Site address or WP_SITEURL constant) and WordPress URLs (dashboard, uploads, etc, defined by WordPress Address or WP_HOME constant)… then, in addition to the normal process outlined above, you’ll need to also?MOVE?all the files and folders inside the?reynoldstocks?subdirectory to the root directory.

    Thread Starter satimis

    (@satimis)

    Hi,

    Thanks for your advice.
    
    There are 36 websites hosted on HostGator server with their folders under /public_html/
    
    Non of other websites have this problem except reynoldstocks. The technical support of HostGator told me that there are 3 options.
    
    Option-1
    Move all files of reynoldstocks to root
    
    Option-2
    Create redirection on URL "reynoldstocks"
    
    Option-3
    Reinstall "reynoldstocks".
    
    There is no way changing the URL "https://reynoldstocks.com/reynoldstocks/" to "reynoldstocks.com
    
    I selected Option-2.
    
    I'll reinstall "reynoldstocks" when I have time. It won't be too complicate in my case. I have the cloned website of "reynoldstocks" running on local server which is not open to public. I just create the Duplicator packages of the cloned website, upload them to the cPanel of HostGator server and run /reynoldstocks/installer.php on Internet, done.
    
    In the past, I have performed similar action on other websites without problem.
    
    Regards
Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How to change the URL of a website’ is closed to new replies.