Forum Moderators: phranque
We've used it for redirecting traffic from a directory to another web site, but I am not yet convinced that it will redirect subdomain traffic like we want it to.
The www.main.com is a live site - we just want the subdomain.main.com traffic to be redirected to /directory. Is it possible usign mod_rewrite?
Welcome to WebmasterWorld [webmasterworld.com]!
Yes, just put code similar to that in this thread [webmasterworld.com] into an .htaccess file in the directory tree with or above the subdomain files, or do it at the server config level in httpd.conf.
Jim
Thank you for your response! I'll check out the syntax.
Unfortunately this is a web site on a server that is not ours, so editing the httpd.conf is out.
The ISP wanted to charge us for a full domain (with the full monthly fee) for forwarding subdomain.main.com to a specific directory inside main.com. I figured it would only involve a couple of lines in httpd.conf, but I couldn't talk them into seeing it that way.
Thanks again!
If you want it pointed to a specific subdirectory, they claimed it was the same (to them) as a new domain.
Yet, they only charge $5/month for a redirect of a of domain name to another domain, so I told them this should be similarly priced and that I would pay their $5/month. Nope, according to them - it's a new domain!
And this from one of the larger ISPs in the area...
All the code you need has been posted here on WebmasterWorld, including a cool arbitrarily-named subdomain to subdirectory mapping trick. Actually, the member who posted that trick deserves your $5 a month for beer. Send it to Andreas F. in Berlin at the current exchange rate...
Actually, that may be the best answer -- Go ahead and have them point all of your subdomains at your Web root, then use mod_rewrite [webmasterworld.com] to sort them into subdirectories from there. Relatively easy, fully under your control, and no silly charge from your host.
Jim