Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    php and subdomain how?

    hi

    i hear that even if the subdomain are not allowed to make on some domain ..like sms.somedomain.com now when what i think is that when some page is not found on somedoamin it searches for 404 error page...which can b customized.. what if that 404 error page is customized in such a way that.. it picks up/records the subdomain that was requested and then redirects the visitor according to subdomain searched for..

    like.. www.loop.com is the main domain

    sms.loop.com is the search domain searched for which actaully doesnt exist..

    404 page records /captures the request and then redirects the user to URl like www.loop.com/fix/sms/index.php

    can it b done?
    Move on....

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,108
    Thanks
    11
    Thanked 101 Times in 99 Posts
    depending on how your DNS is set up your request may never make it to your 404 error page , eg it will most likely go straight to your main domain index page ...

    you can (either in your 404 or your index page) check the requested hostname ..

    eg
    PHP Code:
    <?
    if( strstr$_SERVER['HTTP_HOST '] , 'yaks.mydomain.com' ) ){
        
    header("location:./yaks/index.php");
    }
    ?>
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

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