.htaccess - How can I link a subdomain to a joomla user? -
.htaccess - How can I link a subdomain to a joomla user? -
we've got custom component sorts of wonderful things a registered user. among requirements ability utilize username subdomain retrieve , utilize variety of settings. e.g. http://abc.ourdomain.com must retrieve jos_users record username "abc". there utilize info in session , carry on component functions values.
i've tried tinkering $_server["http_host"] things started, hoping there cleaner approach htaccess, or plugin serve purpose better.
something might work in 1 .htaccess file:
options +followsymlinks rewriteengine on rewritebase / rewritecond %{http_host} !www\. [nc] rewritecond %{http_host} ^([^\.]+)\.ourdomain\.com [nc] rewritecond %{request_uri} !getuser\.php [nc] rewriterule .* http://ourdomain.com/getuser.php?user=%1 [l]
maps silently
http://abc.ourdomain.com
to:
http://ourdomain.com/getuser.php?user=abc
captures subdomain abc
grouping %1 , appends query script.
abc
is variable string.
getuser.php
can script. key user
example, can name too.
for permanent redirection, replace [l] [r=301,l]
.htaccess subdomain joomla2.5
Comments
Post a Comment