|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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?
|
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
How about add a javascript redirection onto the domain?
Last edited by jester : April 10th, 2001 at 01:17 AM. |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
Thanks, freebsd.
That worked beautifully. Helicon |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > domain redirect using RewriteEngine |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|