You can make virtual host in apache. It’s quite simple. If you are using windows. There are only two steps.
Step 1 :
Just open the file
C:\xampp\apache\conf\extra\httpd-vhosts.conf
Just add the below code snippet at the end of the file
<VirtualHost *:80> ServerName project.dev DocumentRoot "D:/xampp/htdocs/project/" <Directory "D:/xampp/htdocs/project/"> # use mod_rewrite for pretty URL support RewriteEngine on # If a directory or a file exists, use the request directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Otherwise forward the request to index.php RewriteRule . index.php # use index.php as index file DirectoryIndex index.php # ...other settings... </Directory> </VirtualHost>
Step 2
Open the file
C:\Windows\System32\drivers\etc\hosts
And then add the line below
127.0.0.1 project.dev