icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » Shared Hosting » redirecting from one subdomain to another subdomain

Shared Hosting Questions about your shared hosting account.

Reply
 
LinkBack Thread Tools Search this Thread
Old August 9th, 2006, 12:43 AM   #1 (permalink)
Registered User
Seasoned Poster
 
T313C0mun1s7's Avatar
 
Joined in Mar 2006
Hosted on SH95 (72.29.90.43)
49 posts
Gave thanks: 4
Thanked 2 times
Question redirecting from one subdomain to another subdomain

I am setting up multiple corporate catalogs for a client, and one of their clients has three identities, but it in reality will all be one catalog. each client catalog has a subdomain.

Let us assume 4 clients, so 4 subdomains. Sub_1, Sub_2, Sub_3, Sub_4, and Sub_5 (you will see why 5 in a second) will act as the subdomains in this case.
Sub_1 is an independent client and is out of the equation, so lets not worry about it expect to say that Sub_1 is one of many reasons the others can not be in the root directory. Sub_2, Sub_3, and Sub_4 is the normal way those clients will navigate to the site. Sub_5 holds the actual site that Sub_2, Sub3, and Sub_4 will be visiting, so I need to redirect all three of those subdomains to Sub_5.

I am not sure I can do this in cPanel, but I think I can with a .htaccess file in my root. So finally here is the question, if I have a file in my root that contains this:
Code:
Redirect /Sub_2 /Sub_5
Redirect /Sub_3 /Sub_5
Redirect /Sub_4 /Sub_5
  1. Will this do what I want in redirecting anything that comes in from Sub_2/3/4 to Sub_5 even if you navigate to it via http://Sub_2.domain.com?
  2. What will the URL in the visitors' address bar look like after the redirect?
  3. Are there any caveats to this method I should be worried about?
Thank you in advance for you help.
__________________
T313C0mun1s7
PASS65 (72.29.93.65) - Reseller
========================
T313C0mun1s7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 9th, 2006, 2:52 AM   #2 (permalink)
Race Surpass
Super #1
 
MarkRH's Avatar
 
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,222 posts
Gave thanks: 18
Thanked 86 times
One thing I do know. With redirecting, the browser's address bar will look like whatever the subdomain/directory you are redirecting to. So with this example, the address bar will look like http://sub_5.domain.com after the redirection. If you don't want this to happen, then what you need to do is have each subdomain act like a parked domain that points to the sub_5 folder as their root folder so that the URL doesn't change in the browser.

I believe that support can make this happen for you if that's what you want. Well, at least they said they could do that for me when I wanted to make a subdomain of an add-on domain have as its root a folder within the add-on domain.

Mark H.
MarkRH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 9th, 2006, 3:05 AM   #3 (permalink)
Registered User
Seasoned Poster
 
T313C0mun1s7's Avatar
 
Joined in Mar 2006
Hosted on SH95 (72.29.90.43)
49 posts
Gave thanks: 4
Thanked 2 times
I am in a time crunch, and I am not sure if support would get to this quick enough. I wonder if cPanel would handle doing a parked domain to a subdomain? Hmm...

It's just that I heard using cPanel to mix subdomains and redirects (which is essentially what a parked domain is) is a
__________________
T313C0mun1s7
PASS65 (72.29.93.65) - Reseller
========================
T313C0mun1s7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 9th, 2006, 11:55 AM   #4 (permalink)
minor deity
Super #1
 
Bigjohn's Avatar
 
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,387 posts
Gave thanks: 28
Thanked 94 times
You can park a domain to a subdomain.

You just don't create a subdomain then a redirect for that same subdomain (i.e. create 'site5.domain.com' as a sub, then create a redirect for 'site5.domain.com > /site5'

Follow?

John
__________________
Proud to be a Surmunity Mod!
XEON PASS60 PASS61
Make a fundamental difference!
My Sites:
Curious about Brewing Beer? Join the community!
>>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax
Get into an Art museum
Victorian London
It's your brain -ON WEB - mybrainhost.com (under development)
What SHOULD Government do? Much Less than it Does!
Bigjohn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 9th, 2006, 12:10 PM   #5 (permalink)
Registered User
Seasoned Poster
 
T313C0mun1s7's Avatar
 
Joined in Mar 2006
Hosted on SH95 (72.29.90.43)
49 posts
Gave thanks: 4
Thanked 2 times
Actually I just did it with a .htaccess file in the root of each sub I wanted to redirect.
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub_2.domain.net$ [OR]
RewriteCond %{HTTP_HOST} ^www.sub_2.domain.net$
RewriteRule ^(.*)$ http://sub_5.domain.net [L]
Basically the same as cPanel would do if I did a subdomain redirect but without the r=301 HTTP "permanently moved" redirection. I had hoped not having the 301 would keep the new location masked (it normally does) but I am unable to confirm as I removed that as an afterthought and the browser will hold on to the permanent redirection. I tried going to another computer to check it, but both are behind the same proxy.

I have this one solved. Thank you.
__________________
T313C0mun1s7
PASS65 (72.29.93.65) - Reseller
========================
T313C0mun1s7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On