How to change a WordPress installed in the WP directory to the root directory?

 

When we perform a WordPress installation we can choose the directory in which it will be done, sometimes it runs in the default WP directory

If it is a new WordPress installation in which no change has been made in the default template, we suggest entering Softaculous app installer and select "List of Installations" in the upper right

Once we enter, we will see the existing WordPress installations and from there we can uninstall it.

To correctly perform a new installation in the root directory, we simply make sure that the field destined for the directory is empty (without WP)

 

If it is an installation in which you have made modifications and you do not want to start from scratch with a new template, we suggest the following steps:

  1. Access the cPanel of the corresponding account and click on the File Manager option
  2. Press the Configuration button (upper right corner) and make sure that the option "Show hidden files (dotfiles)" is checked. If not, check it and press the Save button
  3. Now you have to navigate to enter the directory where WordPress is installed. Once there, you have to select all the files and folders, right-click on the selected files and press the Move option. In the path, the destination directory should remain. In the case of being public_html, for example, it must remain «/ public_htm /«. Then press the Move file (s) button
  4. After the files are moved, we have to modify the database. We must go to the WordPress database from phpMyAdmin, press the table XXX_options (XXX can be any name, it is different in each installation). In the "option_value" of "home" and "siteurl" we must leave the correct URL for the site to be seen. For example, if it was "http://domain.com/wp" and we moved the site to public_html, now it should be "http://domain.com" in both fields
  5. In the site's .htaccess, make sure that the path to the index.php is correct. That is, if these lines of code are displayed:

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /wp/

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /wp/index.php [L]

</IfModule>

We have to correct the third and penultimate line, so that it remains with the correct route, that is:

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

 

Done!

You can contact our technicians in case of any other question.

  • Email, SSL
  • 0 Los Usuarios han Encontrado Esto Útil
¿Fue útil la respuesta?

Related Articles

PHP files are downloaded instead of executed, how do I solve it?

Sometimes it happens that when trying to access your website, instead of the PHP files being...

How to enable debug mode in Moodle?

If we continuously receive errors in our Moodle it is best to activate the debugging mode and...

How to access webmail to send and receive emails?

     1.       Enter Webmail from yourweb.com/webmail address (changing "yourweb.com” address...

How to increase the limit allowed by WordPress to upload files?

  Sometimes it is necessary to extend the limit that WordPress has to upload files.   This...

What is an inode and how is it limited in Neolo hosting?

 What is an inode?An inode is a data structure on a linux / Unix file system. An inode stores...