Incase if you want to restructure website url, we have to redirect the URL from sub folder or sub directory to ROOT folder, for example here I will use "public_html"
Its possible to do that in two options using htaccess. The below methods can redirect all the http://thelinuxfaq.com/about requests to http://thelinuxfaq.com/
Option 1:
Create a .htaccess file inside public_html directory and add the following line:
RewriteEngine on
RewriteRule ^about/(.*)$ /$1 [R=301,L]
RewriteRule ^about/(.*)$ /$1 [R=301,L]
(or)
Option 2:
Create a .htaccess file inside public_html directory and add the following line:
RewriteEngine On
RewriteRule ^(.*)$ /$1 [R=301,L]
RewriteRule ^(.*)$ /$1 [R=301,L]
Comments (0)