![]() Note it must be the same domain name that you used in Step 3. ServerName (example.test) should also be replaced your chosen domain name. Example, if your project is in a subfolder then add the subfolder “ c:/xampp/htdocs/folder/subfolder/ You should replace " c:/xampp/htdocs/example/"with location of your project. Scroll to the bottom end of the file and add the following code:ĭocumentRoot "C:/xampp/htdocs/foldername/" If it asks you to choose a program to open it, choose Notepad. Open the follow directory C:\xampp\apache\conf\extraĭouble click to open a file called "httpd-vhosts". Select the file and it will prompt "file already exists, do you want to override the file?", to which you must select "Yes". You will see a file on top called "hosts". Change the directory on the Save Popup Window to the following folder: C:\Windows\System32\drivers\etc Paste the content into the notepad file that you opened as an administrator in step 4.1.Ĭlick "Save As" on the new notepad. Right click on notepad and run it as administrator.Ĭopy the full contents of hosts file that we previously opened in step 3. ![]() In your windows startup search bar, type "notepad". If you do, Go to step 4.1, if not skip to Step 5. You could get a message prompt saying that you don't have the right/administrator permissions to replace the file. There should be a popup window asking you if you want to replace the file. In the "Save Type As" dropdown select 'All Files'. io, etc), otherwise it will conflict with your access to other websites on internet.Ĭlick Save(Shortcut for Windows is CTRL S) to overwrite the changes to the file. - Type in your local machine address(127.0.0.1) follow by the domain name.Scroll to the end of the file and add the following line: 127.0.0.1 example.test If it asks you to choose a program to open it, choose "Notepad" or your preferred text editor. There you will find a file called "hosts". Open the directory below in file explorer: C:\Windows\System32\drivers\etc It might work differently for other operating systems or different versions of those systems. ![]() This process assumes you are running Windows 10 and XAMPP environment. There are a number of things you can accomplish better with this. Instead of typing the full url, you could route your custom domain to that specific subfolder. For example, let's say, your website is located at C:xampp/htdocs/folder/example/.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |