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

Re: [cobalt-developers] change ip address problems



Barry Titmarsh wrote:
> 
[regarding rewrite conditions and rules in httpd.conf]
> 
> What does this do ?

The VirtualHost configuration block rewrite rules redirect browsers to
the site's fully qualified domain name.  This requires http 1.1
compatibility, for 1.0 compliant systems comment out the RewriteCond and
RewriteRule statements.

Say you create a site with fqdn www.customer.com.  You add a DNS A
record resolving www.customer.com to its IP address.  You also add an A
record resolving customer.com to the same IP address.  If someone types
http://customer.com/ in their web browser, the RaQ will automatically
redirect their request to http://www.customer.com/.  It looks
professional.

Other rewrite rules in httpd.conf handle the /admin, /siteadmin and
/personal redirection into the administrative web interface.


	-- Will


> 
> RewriteCond %{HTTP_HOST}                !^194.153.75.20(:80)?$     new ip
> address
> RewriteCond %{HTTP_HOST}                !^194.153.75.19(:80)?$     old ip
> address still there.
> 
> See extract below.
> 
> NameVirtualHost 194.153.75.20
> <VirtualHost 194.153.75.20>
> ServerName boobox.sheringham.org.uk
> ServerAdmin admin
> DocumentRoot /home/sites/home/web
> RewriteEngine on
> RewriteCond %{HTTP_HOST}                !^194.153.75.20(:80)?$
> RewriteCond %{HTTP_HOST}                !^boobox.sheringham.org.uk(:80)?$
> RewriteRule ^/(.*)                      http://boobox.sheringham.org.uk/$1
> [L,R]
> RewriteOptions inherit
> AliasMatch ^/~([^/]+)(/(.*))? /home/sites/home/users/$1/web/$3
> AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/home/users/$1/web/$3
> AddHandler server-parsed .shtml
> AddType    text/html     .shtml
> AddHandler cgi-wrapper .cgi
> AddHandler cgi-wrapper .pl
> </VirtualHost>
> <VirtualHost 194.153.75.20>
> ServerName www.snelling.org.uk
> ServerAdmin admin
> DocumentRoot /home/sites/site3/web
> RewriteEngine on
> RewriteCond %{HTTP_HOST}                !^194.153.75.19(:80)?$
> RewriteCond %{HTTP_HOST}                !^www.snelling.org.uk(:80)?$
> RewriteRule ^/(.*)                      http://www.snelling.org.uk/$1 [L,R]
> RewriteOptions inherit
> AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site3/users/$1/web/$3
> AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site3/users/$1/web/$3
> AddHandler cgi-wrapper .cgi
> AddHandler cgi-wrapper .pl
> </VirtualHost>
> 
> Barry