Hi there,
Trying to redirect http://domain.com to http://domain.com/subfolder/
Please help.
Need to redirect http://domain.com to http://domain.com/subfolder/
Moderator: Staff
cPanel Server Management
@ 30$ Onwards
@ 30$ Onwards
Re: Need to redirect http://domain.com to http://domain.com/subfolder/
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.
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/
htaccess rule worked. Thanks man :)