How to redirect complete WordPress subfolder from .htaccess file?

How to redirect complete WordPress subfolder from .htaccess file?


  

1.    Kindly login to the Cpanel with with the URL as http://domainname.com/cpanel 


       or http://domain_name:2083 (with SSL) or http://domain_name:2082  (NON SSL).



2.    Click on "File Manager" under the "Files" category to proceed.





3.    Click on "Settings" from the top right corner of the page. Select the Document Root 


       and make sure Show Hidden files(dotfiles) is selected. Remember to click save.




 

4.    Right click on ".htaccess" file and then click on "Edit" to proceed.





5.    A pop up page will be shown, then click on the "Edit" button to proceed.





6.    Before edit the .htaccess file, you need to copy a backup .htaccess to your local PC.


Existing .htaccess should look something like:
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
==================================================

Add a redirect for complete folder:
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.