PHP and Sub-Domains

Discussion in 'PHP' started by Nerve, Nov 21, 2008.

  1. #1
    Is there anyway along with .htaccess I can create subdomains using reqrite rules?

    Example:

    something.mysite.com is the same as mysite.com/index.php?p=something

    Thanks :)
     
    Nerve, Nov 21, 2008 IP
  2. wmtips

    wmtips Well-Known Member

    Messages:
    601
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
  3. butterman

    butterman Guest

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?domain.com$ [NC]
    RewriteRule ^same/(.*) http://$1.domain.com [R=301,L]
     
    butterman, Nov 22, 2008 IP