How To Move Wordpress To a Subdirectory
Steps to move Wordpress to a subdirectory.
Posted in Code on September 2, 2017 – 1 min read
- Change
.htaccess
in the subdirectory, i.e.example
, where Wordpress now sits
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /example
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /example/index.php [L]
</IfModule>
# END WordPress
- Edit
wp-config.php
and add the following lines
define('WP_HOME','https://domain.com/example');
define('WP_SITEURL','https://domain.com/example');