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

Re: [cobalt-users] Redirect



> What im interested in finding out (if any one knows) is how to make it
when
> someone types in domain.com vs www.domain.com, to KEEP it at domain.com,
> instead of automatically forcing the url to rewrite it self to include the
> www.    Every time I write domain.com the browser automatically kicks me
to
> www.domain.com
>
> Any suggestions?
>

I've setup our server to handle 'Parked' domains in much the way you're
looking for.

To achieve this I made the following changes:

(1) Reserve an IP for 'parked' domains.
(2) Setup parked.netfocus-solutions.net on the reserved IP (194.25.124.155)
(3) Setup the DNS of any parked domains to point to this IP
(4) Modify  /etc/httpd/conf/httpd.conf to stop the domain name being
re-written:
     I've commented out any lines beginning 'Rewrite'
    i.e.,

NameVirtualHost 194.205.124.155
<VirtualHost 194.205.124.155>
ServerName parked.netfocus-solutions.net
ServerAdmin site2
DocumentRoot /home/sites/site2/web
#RewriteEngine on
#RewriteCond %{HTTP_HOST}                !^194.205.124.155(:80)?$
#RewriteCond %{HTTP_HOST}
!^parked.netfocus-solutions.net(:80)?$
#RewriteRule ^/(.*)
http://parked.netfocus-solutions.net/$1 [L,R]
#RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site2/users/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site2/users/$1/web/$3
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
AddHandler server-parsed .shtml
AddType    text/html     .shtml
</VirtualHost>


(5) The website at parked.netfocus-solutions.net has a simple PHP script
that displays our logo with a "Welcome to " + HTTP_HOST
     Where HTTP_HOST is a variable that contains the requested domain name.

Point (4) above is probably the answer to your question but I've outlined
the procedure for completeness.

I hope the above helps,
                                        John