I have created a subdomain yesterday as http://www.subdomain.example.com. This has created a directory at the root by the name of subdomain. Now when i open http://www.subdomain.example.com, it gets redirected to http://www.example.com/subdomain. How to keep my url from showing the directory path i.e. in address bar it keep showing http://www.subdomain.example.com , while showing content from the directory subdomain.
I have a shared hosting account at hostgator.
Thanks for the help
I have created a subdomain yesterday as www.subdomain.example.com. This has created a directory at
Share
In your .htaccess file, turn off the redirect and use mod_rewrite:
This checks if the requested host is either
www.subdomain.example.comorsubdomain.example.commakes sure the request doesn’t already start with a/subdomainand appends it otherwise. This redirects internally on the server so your browser doesn’t actually get redirected (address bar will still say: subdomain.example.com).