.htaccess - Htaccess redirect subdomains to a specific page without changing the link -
i working on php script on generate links random subdomains.for example : x.domain.com sius.domain.com x5-.domain.com , on. in fact these subdomains doesn't exist want when user goes link (random).domain.com shows content of domain.com/result.php?rand=(random). ps:i considered (random) variable. , want exclude www. tried this:
rewriteengine on rewritecond %{http_host} !^www\.domain\.com$ [nc] rewriterule ^ http://domain.com/result.php [l,r]
but nothing seems work. can ?
try with:
rewriteengine on rewritecond %{http_host} !^www\. [nc] rewritecond %{http_host} ^(.+)\.domain\.com$ [nc] rewriterule ^ /result.php?rand=%1 [l,qsa]
you can't redirect (http://...
, [r]
) without link change. code rewrite without redirection.
Comments
Post a Comment