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

What steps should I follow so that a contact form created in WordPress can work?

  When we configure a contact form, WordPress uses PHP's mail () function by default to send...

How to redirect the website from HTTP to HTTPS?

  In this article you will learn how to redirect the users who enter the HTTP version of your...

How to create a web redirect?

  The redirect tool in cPanel will allow you to redirect your website visitors from a source...

How do I cancel a claim or return order on PayPal?

  You can cancel a claim or return request by following these instructions:   Log into...

How to install WordPress in a temporary URL?

Many times for one reason or another we need to use temporary URLs, either because we need to...