+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: $15 for Wildcard subdomain .htaccess

  1. #1
    Junior Member krazyguy
    Join Date
    Mar 2008
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Thumbs up $15 for Wildcard subdomain .htaccess

    I need an HTACCESS, MOD REWRITE code that will create dynamic sub-domains.
    The URL will need to be like this:
    Code:
     
    will contain the content from
    Code:
     
    Payment via paypal.

  2. #2
    ori
    ori is offline
    Senior Member ori is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    australia
    Posts
    464
    Thanks
    0
    Thanked 33 Times in 5 Posts
    Rep Power
    0

    Default

    whats ur host like vps, dedicated, shared, master reseller etc

  3. #3
    Junior Member krazyguy
    Join Date
    Mar 2008
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    i have hostgator shared a/c with wildcard dns enabled

  4. #4
    Senior Member sladex is on a distinguished road sladex's Avatar
    Join Date
    May 2009
    Location
    Unknown
    Posts
    192
    Thanks
    1
    Thanked 3 Times in 1 Post
    Blog Entries
    1
    Rep Power
    2

    Default

    There is my own SUBDOMAIN REGISTRATION SCRIPT. Without htaccess But work fine.


    Maybe you can do something self ;)
    STOP SAYING LOL

  5. #5
    Super Moderator subzero is an unknown quantity at this point subzero's Avatar
    Join Date
    Mar 2006
    Location
    Your Screen.
    Posts
    2,828
    Thanks
    76
    Thanked 75 Times in 39 Posts
    Blog Entries
    2
    Rep Power
    0

    Default

    Code:
            RewriteEngine on 
            RewriteCond %{REQUEST_FILENAME} !-f 
            RewriteCond %{REQUEST_FILENAME} !-d 
            RewriteCond %{HTTP_HOST} ^([^.]+).mydomain.com$ [NC] 
            RewriteRule ^([A-Za-z]+)(/)?$ index.php?customer=$1
    




    Super Cheap hosting:
    Read Tearms&Conditions here:
    FAQ:
    Support forum:


    WapMasterz.Net is back with new forum style!!
    Click this image to goto wapmasterz site!



  6. #6
    Junior Member krazyguy
    Join Date
    Mar 2008
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    thanks subzero i tried ur code but not working. redirecting to index page.
    i trid this codes too but not working.

    Code:
    <IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ([^\.]+).site.(.*)
    RewriteCond %{HTTP_HOST} !^wap.site.(.*)
    RewriteCond %{HTTP_HOST} !^www.site.(.*)
    RewriteRule ^(.*)$ index.php?id=%1 [L,NC]
    </IfModule>
    
    Code:
    <IfModule mod_rewrite.c>
    
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(.*)\.site\.com [NC]
    RewriteCond %1 !^(www|wap)$ [NC]
    RewriteRule ^$ index.php?id=%1 [L]
    
    </IfModule>
    
    Last edited by krazyguy; 13-01-10 at 12:10.

  7. #7
    Senior Member GiLL GiLL's Avatar
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    313
    Thanks
    3
    Thanked 28 Times in 17 Posts
    Blog Entries
    2
    Rep Power
    0

    Default

    i am not sure does your server host provide you correct wildcard dns setting for your domain (ask them for that you need to correct and proper wild card dns setting which need to update httpd.conf and add litle bit things in whm ) if they provide wild card dns setting you do not need to use htaccess just use this method in index.php
    help here



    can you able to open your main page or apache success ?

    PHP Code:
    $serverhost explode('.',$_SERVER["HTTP_HOST"]);
    $sub $serverhost[0];
    if (
    $sub "www") {
    $sub "";

    there are also thing you need to check every http request which will check user from mysql if user is valid and it it will send as you want or where you want else could send at main page or 404 not found as you wish
    Last edited by GiLL; 13-01-10 at 13:18.
    Build Own site Free



    Add your site here



    Free downloads


  8. #8
    Administrator GumSlone has disabled reputation GumSlone's Avatar
    Join Date
    Mar 2005
    Posts
    1,083
    Thanks
    40
    Thanked 133 Times in 60 Posts
    Blog Entries
    2
    Rep Power
    10

    Default

    Quote Originally Posted by GiLL
    i am not sure does your server host provide you correct wildcard dns setting for your domain (ask them for that you need to correct and proper wild card dns setting which need to update httpd.conf and add litle bit things in whm ) if they provide wild card dns setting you do not need to use htaccess just use this method in index.php
    help here



    can you able to open your main page or apache success ?

    PHP Code:
    $serverhost explode('.',$_SERVER["HTTP_HOST"]);
    $sub $serverhost[0];
    if (
    $sub "www") {
    $sub "";

    there are also thing you need to check every http request which will check user from mysql if user is valid and it it will send as you want or where you want else could send at main page or 404 not found as you wish
    there is an error in php code above, it should be:
    PHP Code:
    $serverhost explode('.',$_SERVER["HTTP_HOST"]);
    $sub $serverhost[0];
    if (
    $sub == "www") {
    $sub "";

    coding-talk.com - a place where noobs become professionals

    Advertise your mobile site for FREE with




  9. #9
    Senior Member sladex is on a distinguished road sladex's Avatar
    Join Date
    May 2009
    Location
    Unknown
    Posts
    192
    Thanks
    1
    Thanked 3 Times in 1 Post
    Blog Entries
    1
    Rep Power
    2

    Default

    Sub, that code, like mine :D

    $host = strtolower($_SERVER["HTTP_HOST"]);
    $sk = explode(".", $host);
    if(count($sk) == 3 && $sk[0]!="www")
    {
    }
    STOP SAYING LOL

  10. #10
    Super Moderator subzero is an unknown quantity at this point subzero's Avatar
    Join Date
    Mar 2006
    Location
    Your Screen.
    Posts
    2,828
    Thanks
    76
    Thanked 75 Times in 39 Posts
    Blog Entries
    2
    Rep Power
    0

    Default

    yours in php bro mine is .htaccess




    Super Cheap hosting:
    Read Tearms&Conditions here:
    FAQ:
    Support forum:


    WapMasterz.Net is back with new forum style!!
    Click this image to goto wapmasterz site!



+ Reply to Thread
Page 1 of 2 1 2 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Unlimited Subdomain
    By damoon in forum WAP World
    Replies: 12
    Last Post: 22-12-08, 10:47
  2. Virtual Email Accounts Like Wildcard Subdomains?
    By SpiderWap in forum Coding Forum
    Replies: 4
    Last Post: 16-07-08, 20:52
  3. Wildcard Dns
    By SpiderWap in forum Coding Forum
    Replies: 20
    Last Post: 16-07-08, 01:17
  4. Virtual Subdomain,,, .htaccess
    By SpiderWap in forum Coding Forum
    Replies: 17
    Last Post: 09-05-08, 14:57
  5. Unlimited Subdomain
    By damoon in forum Scripts Forum
    Replies: 0
    Last Post: 01-01-70, 01:00

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

SEO by vBSEO