Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old April 9th, 2001, 12:31 PM
Helicon Helicon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 15 Helicon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

I have a subdomain hosted as subdomain.domain.com. Now I want to have anyone who type in http://www.subdomain.com redirected to http://subdomain.domain.com.

How would I do that with RewriteEngine?

Thanks in advance,

Helicon

Reply With Quote
  #2  
Old April 9th, 2001, 08:48 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Why is http://www.subdomain.com a subdomain? Is it just http://www.anotherdomain.com instead? Are they both on the same server with same IP? What type of redirection, internal or external, do you want?

Reply With Quote
  #3  
Old April 9th, 2001, 11:32 PM
Helicon Helicon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 15 Helicon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I did not make myself very clear, I'm sorry about that. Let me try again.

There are currently two domains, the first one is www.access-china.com, and the second one is www.echina.com. Just recently, we merged www.access-china.com into www.echina.com. So http://www.access-china.com is hosted as http://access-china.echina.com from now on.

In order for our programs to read echina.com cookies, I have to rewrite url from http://www.access-china.com to access-china.echina.com. I'm not sure if this is internal or external redirect, but that is the problem I'm facing right now.

The two domains hosted with different IP, however, they are on the same server using IP virtual hosting.

Hope I made myself clear.

Helicon

Last edited by Helicon : April 9th, 2001 at 11:54 PM.

Reply With Quote
  #4  
Old April 9th, 2001, 11:51 PM
jester jester is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Location: Hong Kong
Posts: 47 jester User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 32 sec
Reputation Power: 9
Smile

How about add a javascript redirection onto the domain?

Last edited by jester : April 10th, 2001 at 01:17 AM.

Reply With Quote
  #5  
Old April 10th, 2001, 04:57 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This is extenal redirect:

RewriteEngine on
#RewriteCond %{SERVER_NAME} ^www\.access-china\.com$
RewriteRule ^/(.*) http://access-china.echina.com/$1 [R,L]

The 2nd line might not be required depending on how you configure vhost.

Reply With Quote
  #6  
Old April 10th, 2001, 01:11 PM
Helicon Helicon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 15 Helicon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks, freebsd.

That worked beautifully.

Helicon

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > domain redirect using RewriteEngine


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway