Okay, What I'm trying to do, is that when a user types a subdomain, if a directory with a coresponding names exists, it will goto that directory. RewriteEngine on RewriteCond %{HTTP_HOST} !^www.* [NC] RewriteCond %{HTTP_HOST} ^([^\\.]+)\\.mmohell\\.com RewriteCond /var/www/vhosts/mmohell.com/httpdocs/games/%1 RewriteRule ^(.*) /games/%1/$1 [L] Code (markup): Example. I goto http://red5.mmohell.com it should direct to the /games/red5/ directory if it exists. Instead it keeps going to the root directory.
Not sure I understand how a 301 would serve my purpose. Is it possible to do a wildcard subdomain and then have it look for a coresponding directory, and point there if it exists? If it's possible, I'd love to know how.