SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: no "WWW" ?

  1. #1
    SitePoint Member
    Join Date
    Mar 2003
    Location
    Minneapolis
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    no "WWW" ?

    I am going to be setting up an intranet for my company. I have seen sites with addresses such as http://intranet.ford.com. How is a directory such as this created? Thanks in advance!

  2. #2
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by liquidbridge
    I am going to be setting up an intranet for my company. I have seen sites with addresses such as http://intranet.ford.com. How is a directory such as this created? Thanks in advance!
    Hi,

    yes you are talking about subdomains and typically you have to use VirtualHost blocks.

    This is a small example:
    (same server handling all subdomains)
    httpd.conf
    NameVirtualHost *

    <VirtualHost *>
    ServerName domainname.com
    ServerAlias www.domainname.com
    DocumentRoot /path/to/domainname.com/www/htdocs/
    </VirtualHost>

    <VirtualHost *>
    ServerName intranet.domainname.com
    ServerAlias www.intranet.domainname.com
    DocumentRoot /path/to/domainname.com/intranet/htdocs/
    </VirtualHost>

    <VirtualHost *>
    ServerName intranet2.domainname.com
    ServerAlias www.intranet2.domainname.com
    DocumentRoot /path/to/domainname.com/intranet2/htdocs/
    </VirtualHost>

    so as you can see we could have domainname.com and www.domainname.com,
    same apply for intranet.domainname.com and www.intranet.domainname.com, etc


    Behind that a DNS must be set to allow "infinite" subdomains using a wildcard.

    It's also possible that
    subdomain1.domainname.com
    and
    subdomain2.domainname.com
    are two different servers in two different locations using two different IP addresses.


    :-) pippo

    p.s.
    vb urls joke...I fixed it,
    thanks Dr.Larry
    Last edited by pippo; Mar 13, 2003 at 04:09.
    Mr Andrea
    Former Hosting Team Advisor
    Former Advisor of '03

  3. #3
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dang vB 3! don't you hate how it keeps putting http:// in front of your www. addresses pippo?

    BTW, i'd have ServerName with the www. and have the Alias without.
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  4. #4
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    >>...don't you hate....
    I hate, I hate...I didn't notice that addition... ;-)
    But I noticed that I can post disabling this option:
    automatically adds _url_ and _/url_ around internet addresses
    ....cool!

    >> BTW, i'd have ServerName with the www. and have the Alias without.
    Yes, that's interesting....
    in particular because using UseCanonicalName to On it will check the ServerName value.


    :-)
    Last edited by pippo; Mar 13, 2003 at 04:11.
    Mr Andrea
    Former Hosting Team Advisor
    Former Advisor of '03

  5. #5
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you could've just unchecked Automatically parse URLs like i did instead of replacing . with _.


    Quote Originally Posted by pippo
    >> BTW, i'd have ServerName with the www. and have the Alias without.
    Yes, that's interesting....
    in particular because using UseCanonicalName to On it will check the ServerName value.
    i don't understand. i know what the UseCanonicalName setting does/affects. are you saying it changes how VirtualHosts work?

    or are you just saying that on error pages and stuff it'll show the client-supplied Host name instead of the httpd.conf one? well, in that case i understand (and think it looks better to have the same ServerName on the error page as in the address bar, etc.). but i would still set ServerName as www.domain.com and ServerAlias as [*.]domain.com just because i think it looks better.

  6. #6
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was meaning that with these rules:
    (...banal example...)

    RewriteEngine on
    RewriteRule !\.(gif|jpe?g|png|css|swf|php)$ /index.php [NC,R]

    a) if it's on it will redirect to the value set in ServerName,
    b) if it's off it will redirect to the value set in http_host (http header)

    So if in case a) I request
    www.mytest.net/aa.gif
    it will redirect to
    mytest.net/index.php (without www because the servername was so)
    Mr Andrea
    Former Hosting Team Advisor
    Former Advisor of '03


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •