subdomain with using htaccess

Discussion in 'PHP' started by Gizlen, Jan 5, 2010.

  1. #1
    hi, guys

    i install a bloghoster script and choose a subdomain for every blogs which created by user.

    htaccess file

    RewriteEngine On
    Options +Followsymlinks
    RewriteBase /
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteCond %{REQUEST_FILENAME} !^.*/images/.*$
    RewriteCond %{REQUEST_FILENAME} !^.*/uploads/.*$
    RewriteCond %{HTTP_HOST}<>%{REQUEST_URI} ^([^.]+)\.woips\.com(:80)?<>/([^/]*) [NC]
    RewriteCond %1<>%3 !^(.*)<>\1$ [NC]
    RewriteRule   ^(.*)$ - [E=BLOGUSER:%1]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^$ /index.php?w=%1 [L]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^page([0-9]+)/([^/]+)?$ /index.php?w=%1&page=$1$2 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^profiles/([^/]+)/([^/]+)?$ /profile.php?u=$1$2 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^profiles/?$ /profile.php [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^albums/([^/]+)/([^/]+)?$ /album.php?u=$1$2 [L]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^archive/(.*)/(.*)/([^/]+)?$ /archive.php?w=%1&y=$1&m=$2$3 [L]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^archive\.php/(.*)/(.*)/([^/]+)?$ /archive.php?w=%1&y=$1&m=$2$3 [L]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^archive/(.*)/([^/]+)?$ /archive.php?w=%1&y=$1$2 [L]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^archive\.php/(.*)/([^/]+)?$ /archive.php?w=%1&y=$1$2 [L]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^archive/([^/]+)?$ /archive.php?w=%1$1 [L]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^archive\.php/([^/]+)?$ /archive.php?w=%1$1 [L]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^friends/([^/]+)?$ /friends.php?w=%1$1 [L]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^friends\.php/([^/]+)?$ /friends.php?w=%1$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^/]+)/friends/page([0-9]+)/([^/]+)?$ /friends.php?w=$1&page=$2$3 [L]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^([0-9]+)/([^/]+).html$ /entry.php?w=%1&e_id=$1 [L]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^([0-9]+)/([^/]+)?$ /entry.php?w=%1&e_id=$1$2 [L]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^&([^/]+)?$ /index.php?w=%1&$1 [L]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^([^/]+)/([^/]+)?$ /index.php?w=%1&category=$1$2 [L]
    RewriteCond %{ENV:BLOGUSER} ^(.+)$
    RewriteRule ^([^/]+)/page([0-9]+)/([^/]+)?$ /index.php?w=%1&category=$1&page=$2$3 [L]
    
    PHP:
    wheni want to visit a blog,i get an error

    http://ykntr.woips.com
    i want to give a subdomain like that from my blog. how can I do?
     
    Gizlen, Jan 5, 2010 IP
  2. GreatMetro

    GreatMetro Peon

    Messages:
    117
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think you need to make sure you set up wildcard subdomains in your zones file
     
    GreatMetro, Jan 8, 2010 IP
  3. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yeah, you'll have to set a * record in your DNS zone and then it should work fine
     
    JAY6390, Jan 9, 2010 IP