Reputation: 1
I want to develop for an existing live website, but setup Apache and the Host file to point to my local named server if it has a different port.
sub.example.com is the live site
sub.example.com:81 to point to my local Xampp named server.
I am trying to use the cookies from the live site to develop an enhancement locally that will be tested and then uploaded to the live site, but the cookies set use the full subdomain, sub.example.com. So when I setup my local server to be dev.sub.example.com, I am not able to read the cookies. So if I can just point the port 81 to my local instead of live, the cookies can be still be read.
I have add into the hosts file
127.0.0.1 sub.example.com:81
and added the virtual host config
<VirtualHost sub.example.com:81>
and pointed to the appropriate directory, but that just doesnt load at all, even though the live site continues to load fine. I get a Time Out connection error. So close!
Upvotes: 0
Views: 125
Reputation: 1
Nevermind, just a weird Firefox issue. Works fine in Chrome and Firefox Private Mode.
Added 2 IP's to hosts file....local IP and actual server IP.
127.0.0.1 sub.example.com
xxx.xxx.xxx.xx sub.example.com
And in the virtual hosts file....added 2 entries...one for the live site....
<VirtualHost sub.example.com:80>
ServerName sub.example.com:80
DocumentRoot "xxx.xxx.xxx.xx"
</VirtualHost>
and the 2nd virtual host and different port points to the local directory...
<VirtualHost sub.example.com:81>
ServerName sub.example.com:81
DocumentRoot "C:/dev/localsite"
</VirtualHost>
Now Im able to use live server authentication and cookie creations on my local dev instance.
Upvotes: 0