.htaccess - How to create dynamic subdomain using PHP and htaccess? -
i have 1 problem: want set php , htaccess make dynamic subdomains. , can not figure out how. url looks this:
www.exemple.com/index.php?subdomain=mike&component=content&id=26&title=people-love-apps
i need this:
www.mike.exemple.com/content/26/people-love-apps.html
i know can done not know solution how it. important me $ _get [] functions read parameter in url.
the problem users on site make web site , free domain (sub-domain) automatically. should automatic.
thanks!
you can't make dynamic subdomains .htaccess
you need configure apache virtual host accept requests multiple domains
see apache documentation - using name based virtual hosts
<virtualhost *:80> servername www.example.com serveralias example.com *.example.com documentroot /www/domain </virtualhost>
adding wildcard subdomain *.example.com
, php application receive requests domain below example.com
, ie garbage.example.com
, busted.example.com
, llama.example.com
, etc.
creating wildcard sub domain using apache virtualhost
multiple domains 1 virtual host | wildcard host (shared hosting)?
apache default virtual host multiple domains
at point, application have determine validity of subdomain , display appropriate error unknown subs.
from there, parse domain mike
.
Comments
Post a Comment