LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache httpd.conf Redirect Subdomain (http://www.linuxquestions.org/questions/linux-server-73/apache-httpd-conf-redirect-subdomain-668162/)

firefly2442 09-07-2008 11:45 AM

Apache httpd.conf Redirect Subdomain
 
Hello all,

I'm trying to do this without using mod_rewrite in Apache. Basically, I want to be able to redirect http://www.mydomain.com/webmail/ to https://www.mydomain.com/webmail/ as well as my subdomain http://webmail.mydomain.com to https://webmail.mydomain.com

Here is my httpd.conf file:

Code:

NameVirtualHost *:80
<VirtualHost *:80>
</VirtualHost>
<VirtualHost *:80>
    ServerName webmail.mydomain.com
    ServerAlias www.webmail.mydomain.com
    DocumentRoot /var/www/html/webmail
        Redirect permanent webmail.mydomain.com https://webmail.mydomain.com
</VirtualHost>

#This works ->
Redirect permanent /webmail https://webmail.mydomain.com

I'm not quite sure what I'm doing wrong, can anyone offer advice?

Thanks in advance! :)

bathory 09-07-2008 12:14 PM

Quote:

Redirect permanent webmail.mydomain.com https://webmail.mydomain.com
You must provide an absolute path in order for the Redirect directive to work. So I guess, the following should work:
Code:

Redirect permanent / https://webmail.mydomain.com

firefly2442 09-07-2008 12:35 PM

Awesome thanks. I can't believe I missed that. I tried it earlier but I think it was outside the virtualhost tags and so it was directing all traffic to the subdomain (obviously not what I wanted).

Thanks again! :)

basu2007 05-10-2012 01:06 AM

Redirect certain request to an given URL
 
Hi,

I have question regarding redirecting certain request to given URL

For Example:

Would like to redirect all request other than /Webmail to //webmail.raj.net...

Can you please let me know how to do it...
I need your help ASAP.....

Great Thanks
Raj & Karthik

lithos 05-10-2012 03:05 AM

It would be best if you start your own new thread with the topic that describes your problem and maybe refer to this thread in it if it's related.

Don't pull out the threads already given solution which is not yours.
If this tread doesn't help you then start a new thread with your problem described.


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