Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.