Yes. As a virtual host. As recommended to me by Conor RIP. I have been using this setup for years.
Set up the site to use an url such as
www.mysite.local
NOT 127.0.0.1/whatever nor localhost/whatever.
The use of those two local domains will cause you issues with sll certificates down the road as browsers tighten up access to those addresses.
Here are the steps required.
Make sure a step works before proceeding further or it's a world of pain.
1) This requires the entry in the hosts file:
127.0.0.1
www.mysite.local
Check this works with a static site.
2) Add the corresponding code in the apache config \apache\conf\extra\httpd-vhosts.conf
This is mine with names changed to protect the innocent.
<VirtualHost *:80>
ServerName
www.mysite.local
ServerAlias
www.mysite.local
DocumentRoot "D:/Documents/PATH TO SITE/public_html"
ErrorLog "logs/vhosts-error.log"
<Directory "D:/Documents/PATH TO SITE/public_html">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerName
www.mysite.local
ServerAlias
www.mysite.local
SSLEngine on
SSLCertificateFile conf/ssl.crt/server.crt
SSLCertificateKeyFile conf/ssl.key/server.key
DocumentRoot "D:/Documents/PATH TO SITE/public_html"
ErrorLog "logs/vhosts-error.log"
<Directory "D:/Documents/PATH TO SITE/public_html">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
#the paths to the certificate may not be as your server...Google is your friend.
Check this works for both http and https on a static site.
3) Local Shop
Change the configs to suit. Check it all works without URI Mapping enabled.
I remember a couple of occasions when it just would not work. Eventually I did a new install using the virtual host url
https://www.mysite.local just to get examples of working configs.
4) Set up the URI mapping as usual.
Bookmarks