$15 for Wildcard subdomain .htaccess

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    $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:
     [URL="http://www.user.domain.com/folder"]www.user.domain.com/folder[/URL]
    will contain the content from
    Code:
    [URL="http://www.domain.com/store/?sub=xxx&path=zzz"] www.domain.com/xxx/?name=user&d=folder[/URL]
    Payment via paypal.

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

    Comment


      #3
      i have hostgator shared a/c with wildcard dns enabled

      Comment


        #4
        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
        Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
        Visit: WapMasterz Coming Back Soon!
        _______
        SCRIPTS FOR SALE BY SUBZERO
        Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
        FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
        _______
        Info & Tips
        php.net
        w3schools.com

        Comment


          #5
          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, 13:10.

          Comment


            #6
            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 http://test.domain.com 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, 14:18.
            left wap stuff

            Comment


              #7
              Originally posted by GiLL View Post
              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

              Setting up Wildcard DNS for Subdomains on Cpanel | Wired Studios

              can you able to open http://test.domain.com 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 "";

              Advertise your mobile site for FREE with AdTwirl

              Comment


                #8
                php_flag register_globals on
                RewriteEngine On

                RewriteCond %{HTTP_HOST} ^([^.]+).\.DOMAIN\.com$
                RewriteCond %{HTTP_HOST} ^([^.]+)\.DOMAIN\.com$
                RewriteRule .* http://DOMAIN.com/%1 [R,L]

                Will work, thats if i understand what you're trying todo

                Comment


                  #9
                  .htaccess
                  PHP Code:
                  RewriteEngine On
                  RewriteBase 
                  /
                  RewriteRule ^([a-z-]+) index.php?$[QSA,L
                  For index.php
                  PHP Code:
                  $sub preg_replace("#(.*?)YOURSITE\.com$#i",'$1',$_SERVER["HTTP_HOST"]);

                  if (
                  $sub == "www." || $sub == "YOURSITE.") {
                  $sub "";}
                  if(
                  $sub != "") {
                  $sub preg_replace("/(^www\.)?(.*)?\.$/i"'$2'$sub);
                  }
                  if (
                  $sub == "YOURSITE") {
                  $sub "";
                  }
                  if(
                  $sub == "") {
                  exit;
                  //or error for no user
                  }
                  $user=$sub;


                  $folder explode("&",$_SERVER['QUERY_STRING'],2);
                  $folder=$folder[1];


                  echo
                  "User: $user  <br />
                  Folder: 
                  $folder <br />
                  "
                  ;
                  ////from here use you coding with those two variables 
                  Last edited by morency; 23.01.10, 23:31.
                  Unamos los corazones,hoy todos somos multicolores!

                  Comment


                    #10
                    dows any one have working demo of this trick?

                    Comment


                      #11
                      does vbseo uses mod rewrite, url rewrite? like one the coding-talk is useing?

                      Comment

                      Working...
                      X