Virtual Subdomain,,, .htaccess

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

    Virtual Subdomain,,, .htaccess

    I know theres a .htaccess code that i can use for this...

    What i wana do is create a virtual subdomain.
    Example people register at my site builder script im coding...

    the path would be like this
    http://siteurl.com/sites/index.php?username
    But i want it to be
    http://username.siteurl.com

    So the .htaccess code should rewrite and make a redirect from
    http://username.siteurl.com
    to
    http://siteurl.com/sites/index.php?username

    So if you for example put in
    http://anyword.siteurl.com it will redirect to
    http://siteurl.com/sites/index.php?username
    ---------------------------------------------------
    Can someone please share this code with me?

    Click here!!!

    #2
    have a look at this link with explains how to do it with htaccess
    Code:
    http://www.webmasterworld.com/forum92/3555.htm

    Comment


      #3
      Thank you Amylee,,,,

      you see, i have unlimited subdomains, had my script running before with php subdomain creation code but it made my surver untity, i had a folder for each user an had the surver create a php page with notice and link redirecting them to theyr sites, and i dont want it like that, but thanx for the url, ill have a look at it now.

      Click here!!!

      Comment


        #4
        I'm not really managing

        Click here!!!

        Comment


          #5
          but ill search google bit more maybe ill get something that will work.

          Click here!!!

          Comment


            #6
            Ok now while i been searching for the thing i want i found other .htaccess stuff that might be usefull to others.

            IP bann
            Code:
            # someone else giving the ruskies a bad name..
            order allow,deny
            deny from 83.222.23.219
            allow from all
            Custom Error Pages
            Code:
            # custom error documents
            ErrorDocument 401 /err/401.php
            ErrorDocument 403 /err/403.php
            ErrorDocument 404 /err/404.php
            ErrorDocument 500 /err/500.php
            Password protect an area
            Code:
            AuthType Basic
            AuthName "restricted area"
            AuthUserFile /usr/local/var/www/html/.htpasses
            require valid-user

            Click here!!!

            Comment


              #7
              Read about "wildcard dns" on google, there is no need to even create any sub domains.. The mod rewrite method explained in the topic amy showed will still require real subdomains to exist or will cause a 404 error.

              Comment


                #8
                did you find the custom subdomain thingy? i have one that works smilar.. where i have custom folders
                wapZan Mobile site builder - Yours is here



                http://wapzan.com?ref=2wap

                Comment


                  #9
                  No bro im strugling lol call me stupid but for once im stuck actually very confused

                  Click here!!!

                  Comment


                    #10
                    No bro im strugling lol call me stupid but for once im stuck actually very confused[/b]
                    If you want to do it without actually creating the subdomains you must learn about "wildcard dns" i had this same issue with a short url script i made.

                    If wildcard dns is enabled on a domain you will still land at the homepage even if you type blahhhhh.mysite.com you can then use php to check the requested url and redirect it based on the subdomain typed.

                    Comment


                      #11
                      could you perhaps give me few examples what to do here? im browsing threw pages on google now but more info would be aprisiated...

                      Click here!!!

                      Comment


                        #12
                        As i said just learn about it, wildcard dns is hard for me to explain, you will get far better info from google. You will need to get your host to enable it unless you have shell access as far as i know.

                        I can't really give a good code example without posting most of a personal script sorry.

                        Comment


                          #13
                          You can find what your need here: http://www.wiredstudios.com/php-programmin...-on-cpanel.html
                          Advertise your mobile site for FREE with AdTwirl

                          Comment


                            #14
                            Thank you Gumslone...

                            Click here!!!

                            Comment


                              #15
                              You can find what your need here: http://www.wiredstudios.com/php-programmin...-on-cpanel.html[/b]
                              Nice tutorial link, i think is the same one i used to learn.

                              @IF you don't have SSH access just mail your host and ask them to set up wildcard dns on the said domain.

                              Comment

                              Working...
                              X