Home web designing cPanel How To Permanent Redirect 301 Using Htaccess URL Rewrite

How To Permanent Redirect 301 Using Htaccess URL Rewrite


Permanent-url-rewrite-301-using-.htaccess.htaccess rewrite is the best and safe method to rewrite url .Using Htaccess you can do all type of redirect such as 410 , 404 or 301 redirects .To move one url to other you have required 301 redirection .Redirect permanent Apache url to other url using htaccess you have to use RedirectMatch command . To redirect 301 htaccess open the file and add specific code link in it .With this way htaccess rewrite Url redirected old link to new link .

Open .Htaccess File

Login to cpanel and then go to .htaccess file . By default htaccess file is hidden . So unhide all files and locate it . If still .htaccess not found then you have to create a new .htaccess file .

Read Also : Enable-gzip-compression-using-htaccess

Best way to edit it , download Htaccess file first then edit it .To edit it you can use only notepad or any other plain text editor . You can’t edit or create .htaccess file using text editors such as Microsoft word or wordpad .

Redirect Permanent Using Redirect 301 htaccess

RedirectMatch 301 command is used to redirect old URL to new one .The code format is as follows .

RedirectMatch 301 Old_URL New_URL

In upper code “Old_URL” represents the deleted or removed url and “New_URL” represent the new location after redirection .

redirect 301 htaccess rewrite For redirect permanent Apache

For example : you want to redirect www.example.com/folder to new URL www.example.com/folder_new then the code format is as following

RedirectMatch 301 www.example.com/folder www.example.com/folder_new

After htaccess rewrite save the file .Now www.example.com/folder URL is permanently redirect to www.example.com/folder_new .