Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to redirect all trafic from the root of my webby to a subfolder on the same domain useing .htaccess

Can someone help me out here?

share|improve this question

2 Answers 2

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.