Sergi
Sergi

Reputation: 1240

Changing Wordpress website URL to the root folder

Right now on my root folder, I have an "Under construction" page. So just an index.html, a style.css file and a htacces file. Then I have a test folder with Wordpress in it, so my website URL is root/test/wordpress. I want to "upload" the website to the root folder so I see the site instead of the under construction page. I have tried changing the website URL in the Wordpress dashboard but that does not work. I have also tried adding the new address in the wp-config file but that doesn't work either.

Upvotes: 1

Views: 1321

Answers (1)

Nostra Damus
Nostra Damus

Reputation: 91

You will have to remove the index.html file as most servers are set to use that over any index.php, wich WP requires to be called. Do that first.

Further down the road, there are two constants that you can add to your wp-config.php file that define the WordPress urls:

define('WP_SITEURL', 'http://example.com'); 
define('WP_HOME', 'http://example.com/path-to-wp-files');

WP_SITEURL defines the url of your frontend WP website and the WP_HOME url is where your wp files reside, these two don't have to match for your site to work.

The result would be that your website address is example.com but your Admin Dashboard is located at example.com/path-to-wp-files/wp-admin/ instead of example.com/wp-admin/

Lastly, if you copy the files to the root directory by hand and make both of the above entries to use the simple version (ie. 'https://example.com') and your domains are setup to that same root directory in your hosting backend/Cpanel or similar then it should work without problems.

Upvotes: 2

Related Questions