How to change Virtual Host Alias


  • | 266 points

    I created a new Wordpress website using the Quick App->Wordpress using {name}.com as my alias domain this worked great. Now, trying to understand how Laragon creates these Virtual Host entries / alias I tried to manually change '.com' to '.test' but was not able to get it to work.

    Here is what I tried:

    • Updated auto file name and content
      auto.example.com.conf - changed name of file to auto.example.test
      #ServerName example.com
      #ServerAlias *.example.com
      ServerName example.test
      ServerAlias *.example.test

    • C:\Windows\System32\drivers\etc/hosts
      Changed
      #127.0.0.1 example.com #laragon magic!
      127.0.0.1 example.test #laragon magic!

    • phpmyadmin: Wordpress vars
      siteurl: http://example.test
      home: http://example.test

    How are we able to change the Virtual Host alias after the fact?


  • | 517 points

    There is a much easier way I think:
    If you go to the Laragon settings, there is a point "Virtual Host" and you can type another URL Endung. For example project.test instead oft project.dev


  • | 266 points

    Not able to find a setting / preference for Virtual Host could someone please break down the steps to change a Virtual host from .com to .test after creating an alias?


  • | 517 points

    I think if yoo go to Menu > Preferences you see the point for Virtual Host in the General card below. if you change the value from {name}.com to {name}.test it'll work. Just reload the www directory and test it....
    See this documentation entry: https://laragon.org/docs/pretty-urls.html


  • | 266 points

    Haven't had a chance to try this as my local environment isn't working any longer.


Log in to reply
 

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