Forum Moderators: phranque

Message Too Old, No Replies

using htaccess to make directories act as subdomains...

or another fix please

         

broker

12:10 am on Feb 23, 2005 (gmt 0)



Please forgive me if this has been covered elsewhere. New to the forum. I have seen a few hints, but not enough for a newbie like me to put all the peices together.

I have a problem changing domains. I have a domain that has a great many subdomains.
I wanted to re-create the subdomains easily on another domain, but the host tells me there is no easy way short of re-entering the data in cpanel. (Don't want to)
I thought there might be an easy way to sort of recreate the "directories" with the same subdomain names on the new server and then use .htaccess to route a request for the subdomain to the individual directory. That would save me from all that data entry.
So a request for subdomain-name.domain.com would result in passing domain.com/subdomain-name, but would still look and act in the browser bar as if it were the subdomain.

Maybe I'm just nuts.

Better, I'd like a way to just "import" all the subdomains and actually re-create the names and directories on the new server. Both are apache. I do not have telnet access to either server, however I can run php and that sort of thing.

Thanks for any help.

jdMorgan

2:17 am on Feb 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



broker,

Welcome to WebmasterWorld!

Yes, we last discussed it seven hours ago... [webmasterworld.com...] ;)

You will need "wild-card" DNS set up, and your hosting co. will have to forward all subdomains to your Web root directory. Then you can use mod_rewrite or scripting to 'sort out' the subdomains easily. If they give you a bunch of mumbo-jumbo about subdomains, remind them that www.example.com is a subdomain of example.com, and they most likely already handle that one for everybody.

Jim