Accessing "mysite.dev" redirects to URL which shows index.php at root folder


  • | 4248 points

    Hey everyone.

    So I set up Laragon to use Auto create virtual hosts and created a new site. The new site shows up as a vhost in drivers/etc/vhosts and in httpd-vhosts.conf, however when I hit the URL for the vhost in my browser, i.e. mysite.dev, it redirects to an IP which doesn't mean much to me and the webpage that is shown to me for this IP is the root of Laragon which shows index.php at the root folder which spits out phpinfo(). I can however access the site using the standard URL: localhost/mysite/public/.

    I am using Laragon at work and we have a proxy here, is that an issue?

    Any ideas on what is happening here and how to remedy the issue?

    Thanks!


  • administrators
    | 56177 points

    @haakym: Maybe proxy issue. How about changing to mysite.local?
    To do this: Just go to Menu > Preferences and change hostname format to {name}.local


  • | 4248 points

    @Leo-Khoa Thanks for your reply.

    I've updated the hostname format to {name}.local and the change has taken effect in httpd-vhosts.conf and drivers/etc/vhosts and I get the following returned:

    *Network Error (dns_unresolved_hostname)

    Your requested host "laravel-datepicker.local" could not be resolved by DNS.

    For assistance, contact your network support team.*

    Any ideas?


  • administrators
    | 56177 points

    It looks like your DNS resolution did not respect your hosts file.


  • | 4248 points

    @leokhoa

    Thanks for your replies.

    It turns out the network I'm on at my workplace uses a proxy for browsing the web and this was interfering with the dns resolution which is why it was only an issue in the web browser and not the command prompt.

    The solution was in the end very simple, I just had to add exceptions to the web browser settings when not to use the proxy for example localhost,127.0.0.1,*.dev.

    I've put more details in my SO question, which I have in turn now answered myself: http://stackoverflow.com/questions/37658876/wamp-localhost-redirects-to-my-ip

    Hope this might help someone else.

    Thanks again for this great tool. I can finally start using it now!


  • administrators
    | 56177 points

    @haakym : Cool! Your solution will help others :)


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.