If you want to redirect a domain to subdirectories then just add the below code in the .htaccess file :
Quote:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
RewriteRule ^$ subdirectory/ [L]
RewriteRule (.*) subdirectory/$1 [L]
</IfModule>
|
This will redirect the domain.com to domian.com/subdirectory but when you access the domain in the browser then it will just show domain.com in the browser not domain.com/subdirectory .
That’s all you are done.
Note : Replace the domain.com to your domainname .