Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 09-07-2008, 11:45 AM   #1
Registered: Apr 2003
Location: USA
Distribution: Ubuntu
Posts: 95

Rep: Reputation: 15
Question 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 to as well as my subdomain to

Here is my httpd.conf file:

NameVirtualHost *:80
<VirtualHost *:80>
<VirtualHost *:80>
    DocumentRoot /var/www/html/webmail
	Redirect permanent

#This works ->
Redirect permanent /webmail
I'm not quite sure what I'm doing wrong, can anyone offer advice?

Thanks in advance!
Old 09-07-2008, 12:14 PM   #2
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,194

Rep: Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676
Redirect permanent
You must provide an absolute path in order for the Redirect directive to work. So I guess, the following should work:
Redirect permanent /
Old 09-07-2008, 12:35 PM   #3
Registered: Apr 2003
Location: USA
Distribution: Ubuntu
Posts: 95

Original Poster
Rep: Reputation: 15
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!
Old 05-10-2012, 01:06 AM   #4
LQ Newbie
Registered: May 2012
Posts: 1

Rep: Reputation: Disabled
Smile Redirect certain request to an given URL


I have question regarding redirecting certain request to given URL

For Example:

Would like to redirect all request other than /Webmail to //

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

Great Thanks
Raj & Karthik
Old 05-10-2012, 03:05 AM   #5
Senior Member
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
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.


apache2, config, files, redirect, virtualhost

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 not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
Please amend apache conf/httpd.conf file please payjoe Linux - Newbie 7 09-21-2007 05:12 PM
Failed to start apache :Starting httpd: Syntax error on line 1027 of /etc/httpd/conf/ payjoe Linux - Newbie 3 09-21-2007 07:24 AM
httpd chokes on ScriptAlias line in Apache httpd.conf lhoff Linux - Software 1 07-14-2003 10:32 PM
apache httpd.conf plisken Linux - Software 1 02-01-2003 02:01 PM > Forums > Linux Forums > Linux - Server

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration