Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Please help me find the basic Mod rewrite for a subdomain.



10:28 pm on Jun 27, 2003 (gmt 0)

Inactive Member
Account Expired


My Web site is simple with only html pages. I'm trying to add a subdomain and the tech at my ISP has put in a request for the "DNS addition". He told me to add a Mod file to the htaccess file on my site. I'm not sure what the file should contain or where I should put it.

Would the following file be correct for the Mod file? Should I save it as an htaccess file and put it in the directory which will house my subdomain files?

RewriteEngine On
RewriteCond %{HTTP_HOST} ^subdomain.domain.com$ [NC]
RewriteCond %{REQUEST_URL}!^/subdomain/
RewriteRule (.*) /subdomain/$1 [L]

I already use htaccess files to password protect several folders on my main domain. I would not want this new htaccess file to interfere with those password protected folders or with the htaccess file for a 404 ErrorDocument which I put in my domain root.

Thank you in advance for any help you can give me.

11:00 pm on June 27, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member wilderness is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 11, 2001
votes: 3

See if this thread helps
6:51 am on June 28, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
votes: 0


Welcome to WebmasterWorld [webmasterworld.com]!

Your tech support person used "loose" language. I am sure he meant to say, "Add a mod_rewrite rule to your existing .htaccess file in your web root (top-level) directory to rewrite the subdomain to a subdirectory."

There is no such thing as a "Mod file" - you just need to add the code in the thread that wilderness cited (or something similar) into your existing top-level .htaccess file.



Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members