Special configuration for requests that do not match any particular virtual host? Apache 2.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I want to make a catch-all virtual host (like the manual mentions below) which redirects any errant hostnames like
http://oopsie.mydomain.com/ to our main hostname at http://www.mydomain.com/   But the below example doesn't work - I'm getting an
infinite redirect from http://www.mydomain.com/ right back to http://www.mydomain.com/ 

What am I missing?

#First virtual host entry
<VirtualHost *:80>
	RewriteEngine On
	RewriteRule 	.* http://www.mydomain.com%{REQUEST_URI} [L,R=301]
	ErrorLog 	/var/log/httpd/error_log
	CustomLog	/var/log/httpd/access_log combined
</VirtualHost>

#Second virtual host entry
<VirtualHost *:80>
	ServerName	www.mydomain.com
	DocumentRoot   /home/mydomain/www
	<Directory /home/mydomain/www>
		Options -ExecCGI +FollowSymLinks +IncludesNOEXEC -Indexes -MultiViews +Includes
		AllowOverride None
	</Directory>
	ErrorLog 	/var/log/httpd/error_log
	CustomLog	/var/log/httpd/access_log combined
</VirtualHost>

http://httpd.apache.org/docs/2.2/vhosts/name-based.html - "If you would like to have a special configuration for requests that do
not match any particular virtual host, simply put that configuration in a <VirtualHost> container and list it first in the
configuration file."


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux