SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist
    Join Date
    Oct 2000
    Posts
    430
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can anyone advise how to do this - and if it is possible.

    I'm trying to do something with subdomains and I would be interested in your views as to whether you think it is possible - and how to accomplish it: -

    I've bought a new domain which I just want to use for pointing at different forums in my vB (as subdomains). The vB forums will be held under my main site domain.

    So say my new domain is Travel.com and my vB forums are stored under mydomain.com. What I wan't to do is create a subdomain such as europe.travel.com which will point to the 'european travel' forum held under on mydomain.com. I would like to still retain the subdomain 'europe.travel.com' in the URL bar.

    Does anyone know how to use subdomains of one domain point to folders in another domain while still keeping the subdomain in the address bar. - Anyone hear do this sort of thing ?

    Cheers

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is quite possible, you'll need to make sure that the subdomain names are in your DNS, and then you can use mod_rewrite to do this.

    So first make sure your host supports mod_rewrite, make sure the canocal domain names are in your DNS and then simply use something like this either in a .htaccess file or in your virtual host container if you have access to the httpd.conf

    Code:
        RewriteEngine On
        RewriteMap lc int:tolower
        RewriteCond %{HTTP_HOST} ^europe\.travel\.com$
        RewriteRule ^(.*) forumdisplay.php?forumid=2 [R,L]

    Unless I am missing what you are trying to do, this should work.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Evangelist
    Join Date
    Oct 2000
    Posts
    430
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, - Thanks for that - it is exactly what I'm trying to do.

    2 Questions:-

    you'll need to make sure that the subdomain names are in your DNS
    I have a really poor knowledge of how domains work could you explain the above and how to achieve it.

    RewriteEngine On
    RewriteMap lc int:tolower
    RewriteCond %{HTTP_HOST} ^europe\.travel\.com$
    RewriteRule ^(.*) forumdisplay.php?forumid=2 [R,L]
    Ok - I want to do this for lots of domains - do I need to repeat all of the above x times or just repeat the last two lines.

    Thanks

  4. #4
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Talk to your host.

    You see even though you can set up a script to handle your subdomains etc once they come to your site thats not enough. They will never make it to your site unless the proper domain name settings have been made for you.

    You can talk to your host about setting up the sub domains for you, or sometimes you can do it from your control panel.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  5. #5
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or your ISP can simply create a wildcard DNS entry for your domain so that

    *.yourdomain.com

    gets sent to

    yourname.com

    I've read that wildcard DNS entries are not strictly Kosher (except for MX records). I wonder why this is, as they seem to work fine. Any clues?


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
  •