Welcome to WebmasterWorld Guest from 54.211.136.250

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)

10+ Year Member



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 Jun 27, 2003 (gmt 0)

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



See if this thread helps
[webmasterworld.com...]
6:51 am on Jun 28, 2003 (gmt 0)

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



oceanview,

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.

HTH,
Jim