The solution that worked for me using apache was first to modify my apache config like this:
Web Server Config
<VirtualHost *:80>
ServerName testdev.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/testdev.com/public
<Directory /var/www/testdev.com/public>
AllowOverride All
Options Indexes FollowSymLinks
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
And dont forget to restart apache after you've modified any config file.
Notice the ServerName Directive has been set to the domain name you want to use, and the VirtualHost *:80 is set to 80.
This will direct all requests from your browser that hit your domain name on port 80 to this virtual host configuration.
Now you have to modify your hosts file as below:
Hosts File
127.0.0.1 localhost
127.0.0.1 testdev.com
Now head to your browser and type in testdev.com this will direct you to your web app