Mr.Shawn Posted February 4, 2008 Share Posted February 4, 2008 Hi everyone, I tried to play with .htaccess of using http://localhost/friends to turn to a subdomain of http://friends.localhost Now, I have remove the RewriteRule but the http://friends.localhost is still there whenever I tried to point to http://localhost/friends Can anyone tell me how to remove the subdomain? Quote Link to comment Share on other sites More sharing options...
madmax Posted February 4, 2008 Share Posted February 4, 2008 Please note: http://httpd.apache.org/docs/2.0/howto/htaccess.html#when In general, you should never use .htaccess files unless you don't have access to the main server configuration file. There is, for example, a prevailing misconception that user authentication should always be done in .htaccess files. This is simply not the case. You can put user authentication configurations in the main server configuration, and this is, in fact, the preferred way to do things. Using .htacess when you have access to the main server config can lead to messy configuration and lots of pitfalls for the new user. Just to outline the way subdomains work... The subdomain is a feature of DNS combined with the way you have configured your server environment. If your DNS name supports wildcard prefixes you have unlimited aliases to your website. However your server needs to be configured to respond to them properly. This also applies to test-rigs such as your local machine (localhost) where you would normally insert DNS-type aliases into your local hosts file. The way to do this would be using ServerAlias/ServerName in the main server httpd config file http://httpd.apache.org/docs/2.0/mod/core.html#serveralias http://httpd.apache.org/docs/2.0/mod/core.html#virtualhost To disable this feature on a live server you need to configure your master server environment config since this is where these directives are in "context" (belong) The main part of the problem - you have set up some form of redirection either by way of rules in your .htaccess files somewhere or may perhaps have created an INDEX.PHP redirect file. You would need to change whichever of these apply. Without all of the code you have installed it would be difficult to comment further Quote Link to comment Share on other sites More sharing options...
Mr.Shawn Posted February 9, 2008 Author Share Posted February 9, 2008 Okay. It had just been fixed with a clear cache. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.