Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Redirecting Domains With Apache - Help!
markjw27
post May 8 2003, 02:14 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 8-May 03
Member No.: 796



I hope someone can help me with this little problem:

I have a linux server running apache. My main website is running as www.mydomain.com. I need to setup the server so that my other registered domains, eg. www.mydomain.net, www.mydomain.org, etc., will redirect to www.mydomain.com regardless of the page opened within the domain.

I am running DNS and have created SOA's for all the extra domains. Each one has only the following added:

CNAME - alias host: www target: mydomain.com

And nothing else - eg. No A, MX, etc.

When I go to one of the extra domains, I just get the server's 404 error page.

Someone in support told me I need to update the httpd.conf file - I have had a look, but this is really stretching my linux skills. Can anyone please tell me exactly what I need to add/edit on the httpd.conf file to update the HTTP headers for the above. Below is the entry for the main domain - there are no other entries for the extra domains:

<VirtualHost 12.34.56.78:80>
ServerName www.mydomain.com
ServerAdmin mydomain@www.mydomain.com
ServerAlias mydomain.com
DocumentRoot /home/domain/domain2/web
ErrorLog "|/usr/ins/intel/bin/webspy /home/domain/domain2/logs/error_log"
TransferLog "|/usr/ins/intel/bin/webspy /home/domain/domain2/logs/access_log"
RewriteEngine on
RewriteCond %{HTTP_HOST} !^12.34.56.78(:80)?$
RewriteCond %{HTTP_HOST} !^www.mydomain.com(:80)?$
RewriteRule ^/(.*) http://www.mydomain.com/$1 [L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/domain/domain2/users/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /home/domain/domain2/users/$1/web/$3
AddHandler server-parsed .shtml
AddType text/html .shtml
<Location />
Options +Includes
</Location>
</VirtualHost>


Many thanks,
Mark
Go to the top of the page
 
+Quote Post
Joey
post May 9 2003, 06:56 AM
Post #2


LinuxHelp Admin
*******

Group: Admin
Posts: 1,096
Joined: 18-September 02
Member No.: 1



Just shove the other domains under serveralias and restart apache.

ServerAlias mydomain.com www.mydomain.net mydomain.net www.mydomain.org mydomain.org

I have the same setup with linuxhelp.ca and linuxhelp.net

ServerName www.linuxhelp.ca
ServerAlias linuxhelp.ca www.linuxhelp.net linuxhelp.net
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 14th December 2017 - 05:11 AM