Hey Fris

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BradM
    Confirmed User
    • Dec 2003
    • 3397

    #1

    Hey Fris

    What was that code you posted to do the easy subdomain creation again?

    Thanks
  • marketsmart
    HOMICIDAL TROLL KILLER
    • Dec 2004
    • 20419

    #2
    a bump for you

    Comment

    • Miguel T
      ♦ Web Developer ♦
      • May 2005
      • 12470

      #3
      Bump for the cause ;)

      Full Stack Webdeveloper: HTML5/CSS3, jQuery, AJAX, ElevatedX, NATS, MechBunny, Wordpress

      Comment

      • fris
        I have to go potty
        • Aug 2002
        • 55785

        #4
        Options +FollowSymLinks

        RewriteEngine On

        # mod_dir fix
        RewriteCond %{HTTP_HOST} !^(www\.)?domain\.com$ [NC]
        RewriteCond %{HTTP_HOST} ^(.*\.)?([^\.]+)\.domain\.com$ [NC]
        RewriteCond %{DOCUMENT_ROOT}/subs/%2%{REQUEST_URI}/ -d
        RewriteRule [^/]$ http://%2.domain.com%{REQUEST_URI}/ [R=301,L]

        # strip sub subdomains
        RewriteCond %{HTTP_HOST} ^.*\.([^\.]+\.domain\.com)$ [NC]
        RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,L]

        # abc.domain.com/ --> /subs/abc/
        RewriteCond %{ENV:REDIRECT_STATUS} ^$
        RewriteCond %{HTTP_HOST} !^(www\.)?domain\.com$ [NC]
        RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$ [NC]
        RewriteCond %{DOCUMENT_ROOT}/subs/%1/ -d
        RewriteRule ^(.*)$ /subs/%1%{REQUEST_URI} [QSA,L]
        Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


        Totally Free Templates

        Comment

        • CaptainHowdy
          Too lazy to set a custom title
          • Dec 2004
          • 94102

          #5
          Originally posted by Fris
          Options +FollowSymLinks

          RewriteEngine On

          # mod_dir fix
          RewriteCond %{HTTP_HOST} !^(www\.)?domain\.com$ [NC]
          RewriteCond %{HTTP_HOST} ^(.*\.)?([^\.]+)\.domain\.com$ [NC]
          RewriteCond %{DOCUMENT_ROOT}/subs/%2%{REQUEST_URI}/ -d
          RewriteRule [^/]$ http://%2.domain.com%{REQUEST_URI}/ [R=301,L]

          # strip sub subdomains
          RewriteCond %{HTTP_HOST} ^.*\.([^\.]+\.domain\.com)$ [NC]
          RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,L]

          # abc.domain.com/ --> /subs/abc/
          RewriteCond %{ENV:REDIRECT_STATUS} ^$
          RewriteCond %{HTTP_HOST} !^(www\.)?domain\.com$ [NC]
          RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$ [NC]
          RewriteCond %{DOCUMENT_ROOT}/subs/%1/ -d
          RewriteRule ^(.*)$ /subs/%1%{REQUEST_URI} [QSA,L]
          !!

          Comment

          • fris
            I have to go potty
            • Aug 2002
            • 55785

            #6
            bump for brad incase he missed it
            Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


            Totally Free Templates

            Comment

            • madawgz
              8.8.8.8
              • Mar 2006
              • 30509

              #7
              Fris you wrote that code from scratch?
              TAEMDLRMSKRJIXMRLSMRJ.

              Comment

              • BradM
                Confirmed User
                • Dec 2003
                • 3397

                #8
                Thanks buddy! Much appreciated!

                Comment

                Working...