How to switch WordPress subfolders from .htaccess file

Before making changes to the .htaccess file, you need to save a copy of the .htaccess backup file to your local PC...

 

Your .htaccess file will look like the one below:

 

Code:

==================================================

# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

 

# END WordPress

==================================================

 

Then add the script as shown below:

 

Code:

==================================================

# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

 

# END WordPress

Redirect 301 /oldfolder http://www.yourdomain.com/newfolder

==================================================


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.