how to set url like subdomain using .htaccess and php

Discussion in 'PHP' started by creativewebmaster, Jan 29, 2014.

  1. #1
    how to set url like subdomain using .htaccess and php
     
    creativewebmaster, Jan 29, 2014 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    if you are asking like

    page1.domainname.com
    3page.domainname.com
    2page.domainname.com

    You need to set this on your dns. Start from that.
     
    bartolay13, Feb 4, 2014 IP
  3. spiderindia

    spiderindia Member

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #3
    <VirtualHost *:80>
    ServerName www.example.com
    ServerAlias example.com *.example.com
    DocumentRoot /www/domain
    </VirtualHost>

    Adding the wildcard subdomain *.example.com, your PHP application will receive all requests for any domain below example.com, ie garbage.example.com, busted.example.com, llama.example.com, etc.
     
    spiderindia, Feb 5, 2014 IP