Search code examples
xamppvirtualhost

Keep XAMPP default page as developing website


I am preparing to create my portfolio site and this is something I always thought. I find XAMPP default admin page useful in some ways to me, but as I am developing website, I can't access it any more.

I want to know is there a way to keep XAMPP default page as I am developing other websites.

I know I can setup virtual hosts for several websites, but is it same for XAMPP? I have done virtual host one time as work. At, first it didn't work(what was CakePHP app), but later I have managed to make it work.

UPDATE: So I found out this post about Hosting multiple local sites with XAMPP and have edited my Virtual Host config file like this:

<VirtualHost *:80>
    ServerName localhost/xampp
    DocumentRoot "C:/xampp/htdocs/xampp/"
</VirtualHost>
<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "C:/xampp/htdocs/"
</VirtualHost>

My windows host file:

127.0.0.1       localhost
127.0.0.1       localhost/xampp

For now, accessing both 127.0.0.1 and 127.0.0.1/xampp redirect me to XAMPP home page, which is in C:/xampp/htdocs/xampp/

When I access localhost, browser redirects me to index.php file(As 127.0.0.1 also should), which is for testing purposes in htdocs folder. However if I try to access localhost/xampp I get error in Chrome - "This webpage has a redirect loop".

I have no idea how to progress on from here.


Solution

  • I found out answer. THe issue was with my naming of xampp admin page domain, instead of using someting, which include localhost for xampp page, I had to use something else, as it will not conflict when using your own naming.

    So my hosts file now:

    127.0.0.1       localhost
    127.0.0.1       xampp-admin
    

    And Apache Virtual Host file:

    <VirtualHost *:80>
        ServerName localhost
        DocumentRoot "C:/xampp/htdocs/"
    </VirtualHost>
    <VirtualHost *:80>
        ServerName xampp-admin
        DocumentRoot "C:/xampp/htdocs/xampp/"
        <Directory "C:/xampp/htdocs/xampp/">
            Order allow,deny
            Allow from all
      </Directory>
    </VirtualHost>
    

    This part(below) didn't change anything, I added, because I saw it in examples, but I still have no idea, what it's useful to:

        <Directory "C:/xampp/htdocs/xampp/">
            Order allow,deny
            Allow from all
      </Directory>
    

    Still, maybe someone can suggest me more conventional name for Xampp admin page?