9/2/19

How to create the virtual host in localhost



Virtual host

laravel:
http://localhost/cms/public/

cms.app
cms.dev

Note: sometimes your browser doesn't allow '.app' and '.dev' the domain that will block your domain. So Please use change the name of your domain name. For example : .test, ...etc.

first of all, we have to create a virtual host.

1. open the notepad (Run as administrator)

2.open the 'httpd-vhosts.conf'
C:\xampp\apache\conf\extra\httpd-vhosts.conf



3. put the code at the end of the line.

<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/cms/public"
ServerName cms.dev
</VirtualHost>



4. open the host file:
C:\Windows\System32\drivers\etc\hosts



5. put the code at the end of the line.

127.0.0.1       localhost
127.0.0.1       cms.dev



6. restart the XAMPP.


No comments:

Post a Comment

About

Hi, I'm Najathi.
I've started entrepreneurial company, Twin Brothers.Inc.
One is self-funded & the other is venture backed. I also send a weekly. where I share relevent, curated links.

Every Week I Publish a short post on writing, publishing, or content of IT Related

Contact Form

Name

Email *

Message *