tarun Posted June 16, 2007 Share Posted June 16, 2007 Everything Has Worked An Ive Even Used My Own PHP Files In: /xampp/htdocs/test/index.php - http://localhost/test But How Do I Create A Sub-Domain Like http://test.localhost Rather Than Using A Directory For My Test Files Thnx, Tarun Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted June 16, 2007 Share Posted June 16, 2007 In order to do that you will have to edit your host file (On Win XP it is in "C:\windows\system32\drivers\etc\hosts") and add the following line to it: 127.0.0.1 test.localhost Then setup a Virtual Host within the httpd.conf file for each subdomain you setup within the hosts file. Here is an example of what you have to do here. And here is the documentation for setting up virtual hosts. NOTE: You must restart Windows when you make any changes to the hosts files. Also make a backup of you hosts file before making any changes - boot into safe mode to make a backup of this file. Quote Link to comment Share on other sites More sharing options...
tarun Posted June 16, 2007 Author Share Posted June 16, 2007 I Can't Save The hosts file once ive edited it In Notepad It Says Cannot create the C:\Windows\System32\drivera\etc\hosts file. Make sure the path and file name are correct. And In EditPlus I Get This is a read-only document. I Think It's Because There Is No File Extension In The "hosts" File What Should I Do Now...? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted June 16, 2007 Share Posted June 16, 2007 When you go to save the file in notepad make sure the File Type box is set to All Files and not Text Document (*.txt). If you cannot save changes to the hosts file then there may be security software on your computer that is preventing you from saving to the hosts file. For example I have ZoneAlarm Firewall. It has the option called 'Lock host file' (under Firewall > Advanced). If that setting is enabled then I get similar errors as to you. Quote Link to comment Share on other sites More sharing options...
tarun Posted June 16, 2007 Author Share Posted June 16, 2007 Well I Used A Different Method It Was Due To Windows Vista UAC (User Account Control) Then I Did As Told And Then Restarted My Computer But I Got "Internet Explorer cannot display the webpage" When Viewing An http://localhost Page So I Reverted Back To The Old Files Now I Shall Wait A While And Read Up On What I Did Wrong And Learn A Bit More Then I May Try Again... Anyway Thnx For Your Help... 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.