I want to redirect all traffic from the root of my website to a subfolder on the same domain using .htaccess
Can someone help me out here?
I want to redirect all traffic from the root of my website to a subfolder on the same domain using .htaccess
Can someone help me out here?
Place this in your webroot .htaccesss
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteCond %{REQUEST_URI} !^/subfolder/
RewriteRule ^(.*)$ /subfolder/$1 [L]
It checks incoming requests, any to that domain get redirected, unless they are already redirected.
HTTP_HOSTin this instance - it's all on one domain. – MrWhite Jul 14 '16 at 15:06