Pages

htaccess to redirect root domain to a subfolder

If you want to redirect your domain yourdomain.com to yourdomain.com/blog then you need to add below code into a .htaccess file in your public_html folder.

Add the following lines to that file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?YourDomain.com$
RewriteRule ^(/)?$ blog [L]

No comments:

Post a Comment