Page 1 of 1
Need to redirect http://domain.com to http://domain.com/subfolder/
Posted: Fri Jun 01, 2018 12:31 am
by sachin
Hi there,
Trying to redirect http://domain.com to http://domain.com/subfolder/
Please help.
Re: Need to redirect http://domain.com to http://domain.com/subfolder/
Posted: Fri Jun 01, 2018 12:34 am
by jamest
Add the following rule to .htaccess in the main account.
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteCond %{REQUEST_URI} !^/subfolder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /subfolder/$1
If not working, try adding redirect from cPanel
cPanel > Redirects > Add redirect to the directory.
Re: Need to redirect http://domain.com to http://domain.com/subfolder/
Posted: Fri Jun 01, 2018 12:37 am
by sachin
htaccess rule worked. Thanks man :)