redirect domain to subdirectory without redirect url

How to redirect domain to sub-directory without redirect to  URL ?
If you want to redirect your domain name to sub-directory but the url shows only domain name
For example : redirect to but the URL shows only
Then add the following rules in your .htaccess file.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^indianwebportal\.com
RewriteRule ^(.*)$$1 [R=301,L]
RewriteRule    ^$   blog/    [L]
RewriteRule    (.*)  blog/$1 [L]

Note: Replace the “” to your original domain name and “blog” to your original directory name.

Related posts

One Thought to “redirect domain to subdirectory without redirect url”

  1. zerodtkjoe

    Thanks for the info

Comments are closed.