10
Quote:
peterr wrote:
Some possible mainfile.php changes ..
le="color: #000000"><?php if $_SERVER["HTTP_HOST"] == sub.domain.com { define('XOOPS_ROOT_PATH', '/home/username/public_html/modules/sub'); define('XOOPS_URL', 'http://sub.domain.com'); } else { define('XOOPS_ROOT_PATH', '/home/username/public_html'); define('XOOPS_URL', 'http://domain.com'); }
but, no doubt you have already tried that, or there are other implications ??
10X peterr
This can't be done since I am generating subdomains automatically with this "mod_rewrite" rules:
le="color: #000000"><?php Options +FollowSymLinks rewriteEngine on # Internally rewrite <subdomain>.mydomain.com/<URLpath> to inthetube.info/subs/<subdomain>/<URLpath> rewriteCond $1 !^modules/ rewriteCond %{HTTP_HOST} !^www.mydomain.com rewriteCond %{HTTP_HOST} ^([^.]+).mydomain.com rewriteRule (.*) /modules/%1/$1 rewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /modules/ rewriteRule ^modules/([^/]+)/(.*)$ http://$1.mydomain.com/$1 [R=301,L]
I do that in the httpd.conf (not .htaccess), and it automatically leads sub-domain.mydomain.com to mydomain.com/modules/sub-domain
What you suggested will make the sub-domain into the XOOPS root
I'm trying to make JIJOE's code fit my needs, but for now with no sucsess
le="color: #000000"><?php // modules changer (insert this 8 lines) if( ! function_exists( 'modules_changer' ) ) { $_SERVER['REQUEST_URI'] = str_replace( 'bridge.mydomain.com' , 'www.mydomain.com/modules/bridge' , @$_SERVER['REQUEST_URI'] ) ; $_SERVER['HTTP_REFERER'] = str_replace( 'bridge.mydomain.com' , 'www.mydomain.com/modules/bridge' , @$_SERVER['HTTP_REFERER'] ) ; function modules_changer( $s ) { return str_replace( 'www.mydomain.com/modules/bridge' , 'bridge.mydomain.com' , $s ) ; } ob_start( 'modules_changer' ) ; }
@ the begining of mainfile.php