Alf
Alf

Reputation: 11

.htaccess redirect help

I'm a complete newbie to .htaccess. I've been looking around trying to figure this out.

I'm trying to figure how to do the following:

The admin guy for the server farm I use stated I need to use an .htaccess file. I've been googling around trying to figure this out but only examples I find will redirect every website hit to a server to the subdirectory. I only want www.def.com calls to redirect to the subdirectory.

Upvotes: 0

Views: 71

Answers (1)

Alf
Alf

Reputation: 11

<Files .htaccess>
order allow,deny
deny from all
</Files>
RewriteCond %{REQUEST_URI} !^/def.com
RewriteCond %{HTTP_HOST} ^(www\.)?def\.
RewriteRule ^(.*)$ foldername/$1 [L]

Upvotes: 1

Related Questions