GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Hey Fris (https://gfy.com/showthread.php?t=667397)

BradM 10-17-2006 03:51 PM

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

Thanks

marketsmart 10-17-2006 03:52 PM

a bump for you

Miguel T 10-17-2006 05:46 PM

Bump for the cause ;)

fris 10-17-2006 05:51 PM

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]

CaptainHowdy 10-17-2006 05:54 PM

Quote:

Originally Posted by Fris (Post 11098406)
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]

:pimp !!

fris 10-18-2006 05:46 AM

bump for brad incase he missed it

madawgz 10-18-2006 07:50 AM

Fris you wrote that code from scratch?

BradM 10-18-2006 08:38 AM

Thanks buddy! Much appreciated!


All times are GMT -7. The time now is 07:25 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123