.htaccess - redirect fake subdomain url to a specific folder -
.htaccess - redirect fake subdomain url to a specific folder -
in website, provide user profiles , separate url them. is, if website url www.sample.com
, if user1
logged in, page redirect www.user1.sample.com
. not sub-domain. want go folder user
if url www.*.sample.com
occurs. , works in user
folder keeping url is. there way using .htaccess
?? not familier htaccess
. general, made htaccess this
<ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_uri} !\.[^./]+$ rewritecond %{request_uri} !(.*)/$ rewriterule ^(.*)$ http://sample.com/$1/ [r=301,l] rewritecond %{http_host} ^www\.sample\.com$ [nc] rewriterule (.*) http://sample.com/$1 [r=301,l] options -multiviews rewritecond %{script_filename} !-d rewritecond %{script_filename} !-f rewriterule ^404/$ ./404.php [l] </ifmodule>
this code works perfect. , work whwn user come in www.sample.com
. can www.*.sample.com
in same .htaccess
file.
i had gone through this thread. not working
any help appreciated..thank in advance
.htaccess subdomain
Comments
Post a Comment