[Cialug] HTTP forwarding/proxying-ish something
chris
chris at ia.gov
Mon Jul 7 09:23:06 CDT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
|>
|> Any apache tricks to easily forward foo.com to www.foo.com?
|
| I'd setup a vhost for foo.com and unconditionally redirect:
|
| <VirtualHost *:80>
| ServerName foo.com
| RewriteEngine On
| RewriteRule (.*) http://www.foo.com/$1 [L,R]
| </VirtualHost>
|
| Just be sure the vhost entry for www.foo.com does not list foo.com as an
| alias.
|
No need to use mod_rewrite for a simple redirect unless you are doing this within an .htaccess file and it appears you
are not.
This will work (uses mod_alias) and has *way* less overhead than firing up the rewrite engine:
<VirtualHost *:80>
~ ServerName foo.com
~ Redirect 301 / http://www.foo.com/
</VirtualHost>
http://httpd.apache.org/docs/trunk/mod/mod_alias.html#Redirect
crr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkhyJsoACgkQvajVK7YH7O6PdgCfVAfqVuz2Tg3A8Wlp4doyXyUe
LhUAoNfWh55Ch4d416jYxNvfRShuAWRt
=YlYs
-----END PGP SIGNATURE-----
More information about the Cialug
mailing list