LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Apache Virtual Host Redirect (https://www.linuxquestions.org/questions/linux-networking-3/apache-virtual-host-redirect-61045/)

granny 05-21-2003 04:39 PM

Apache Virtual Host Redirect
 
Hey guys, I am trying to redirect a virtualhost entry to another virtualhost entry in my httpd.conf file, here is what I have, but it's not working. Can someone please point me in the right direction. Thanks in advance. Oh yeah, everything works perfectly except for the redirect. Actually, I am just trying to redirect apache2 to apache3.

NameVirtualHost 192.168.1.100
<VirtualHost 192.168.1.100>
DocumentRoot "/apache1"
ServerName apache1
</VirtualHost>

<VirtualHost 192.168.1.100>
DocumentRoot /apache2
ServerName apache2
RedirectPermanent http://apache2 http://apache3
</VirtualHost>

<VirtualHost 192.168.1.100>
DocumentRoot "/apache3"
ServerName apache3
</VirtualHost>

KennyK 05-21-2003 05:02 PM

Maybe you should try to do the redirect through dns.

creating a zone file to redirect apache2 to apache3

Regards

granny 05-21-2003 05:37 PM

yeah, I know that would work, but I am trying to do it without editing any of my DNS entries. I want to do it through apache if possible. THX though. Any other suggestions?

KennyK 05-22-2003 10:17 AM

I've never tried it that way be maybe this will work.

<VirtualHost 192.168.1.100>
DocumentRoot "/apache3"
ServerName apache2
</VirtualHost>

granny 05-22-2003 11:04 AM

yeah, that would work for the actual page to be different, but I am actually trying to get it to redirect to a different Virtualhost, not just the directory, guess I am just being picky about how hosts are redirected not wanting to do it through DNS cuz I know that would work, but still, if any one knows a way to do this without changing DNS entries, I would appreciate it. Thanks!

trickykid 05-22-2003 01:20 PM

Why not try it like this:

<VirtualHost 192.168.1.100>
DocumentRoot /apache2
ServerName apache2
RedirectPermanent /apache2 /apache3
</VirtualHost>

Also is that the complete and full path to apache2 and apache3? Like its not in something like /var/www/htdocs/apache2, etc? If so, try adding the full path.

Or you can always just make apache2 an actual symlink to apache3 if the above doesn't work.


All times are GMT -5. The time now is 12:51 PM.