HTACCESS rewriting subdomain.domain.com/folder to folder.domain.com
0 Basically I am building a blog site, I have a wildcard subdomain entry which lands to a specific folder and in that folder all user information are kept in folder wise. For example - user 'dany' register for my site and I assign him a subdomain dany.myblogsite.com . This subdomain lands to userblog folder. Now I verify the all credentials in database and redirect to corresponding folder for example.. to dany.myblogsite.com/dany.myblogsite.com folder. Now I want that in url only dany.blogsite.com is visible instead of full folder path dany.myblogsite.com/dany.myblogsite.com . Basically I want to rewrite url using htaccess. RewriteCond %HTTP_HOST ^dany.blogsite.com$ [NC] Then rewrite any request to /folder RewriteRule ^(dany.blogsite.com*)$ /dany.blogsite.com/$1 [NC,L] I am using above code, but its not working.. I cant figure out how to make above code work dynamically instead of adding entry for every domain php url url-rewriting share | improve this