Welcome to WebmasterWorld Guest from 107.20.75.63

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Domain to Subdomain Rewrite

domain subdomain re-write

     
9:29 pm on Dec 13, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Dec 22, 2009
posts: 92
votes: 0


Is it possible for me to re-write mysite.net to

subdomain.mysite.net using mod-rewrite?


So that when users type mysite.net they see whats in subdomain.mysite.net provided that we already own the domain and subdomain.
9:36 pm on Dec 13, 2011 (gmt 0)

Senior Member

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

joined:July 3, 2002
posts:18903
votes: 0


If they are on the same server, you'd maybe use a rewrite.

If they are on different servers you'd use a reverse proxy.

Both use mod_rewrite and RewriteRules.
11:35 pm on Dec 13, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
posts:12714
votes: 244


when users type mysite.net they see whats in subdomain.mysite.net

Do you want them to see it in both the page and their address bar, or only on the page?

For "same server", read "same userspace" if you are on shared hosting. Otherwise it can get messy.
11:51 pm on Dec 13, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Dec 22, 2009
posts: 92
votes: 0


Sorry I didnt explain clearly. I have a domain mysite.net and Id like so that when i type mysite.net on the browser I see the content from a subdomain of another site: subdomain.mysite2.com

Note the .net and .com differences.

I know that I could do a redirect from mysite.net to subdomain.mysite2.com via the controll panel since im using GoDaddy, but ultimately the above is what i would like to achieve.

I also would like to know if this would help or if its better to just install the subdomain , which is an entirely different site, that is a subdomain of my main site?

Thanks in Advance
12:13 am on Dec 14, 2011 (gmt 0)

Senior Member

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

joined:July 3, 2002
posts:18903
votes: 0


Anything is possible. But further advice can't be given until you address the questions already asked...
4:22 pm on Dec 17, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Dec 22, 2009
posts: 92
votes: 0


Okay this is the final case. I have subdirectories created
in one cpanel account. My main domain already resolves to the index file in www however i have other domains that i want to point to the subdirectories in the same www folder of my hosting account. I guess yes they are in the same folder.

How do i achieve this?
10:31 pm on Dec 17, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
posts:12714
votes: 244


Do you mean that if the user enters

subdomain.example.com

you want them to see content that lives at

www.example.com/subdomain

?

Or do you mean that you've got

www.example.com
www.example.net
www.example.org

all living side by side and you want the user to be sent to the appropriate domain?

What we're trying to figure out is whether you have a DNS question or a proxy question. Suppressing line of thought set off by words "godaddy" which has an ongoing thread of its own.