Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XAMPP localhost redirects to localhost/dashboard

Tags:

xampp

I've just installed xampp-win32-5.5.30 and in xampp control panel both Apache and mysql started without any error but I found:

1)localhost in my browser redirects to another page localhost/dashboard/ and not the xampp start page.

2)localhost/xampp shows the following:

Index of /xampp

[ICO]   Name    Last modified   Size    Description
[PARENTDIR] Parent Directory        -    
Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.5.30 Server at localhost Port 80

In C:\xampp\htdocs\index.php file:

<?php   
    if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) 
    {
            $uri = 'https://';
    } 
    else 
    {
            $uri = 'http://';
    }
    $uri .= $_SERVER['HTTP_HOST'];
    header('Location: '.$uri.'/dashboard/');
    exit;
?>

Something is wrong with the XAMPP installation :-(

Is there something wrong with the installation?

like image 770
Lum Avatar asked Oct 22 '15 14:10

Lum


People also ask

Why my localhost is not working in XAMPP?

Run XAMPP (=> Apache) under an another port: Rename all ports with 80 to 8080 in your httpd. conf file. Your using Windows: Use notpad or editor with Ctrl+H to replace "80".

How do I open Dashboard in XAMPP?

You have an 'Admin' option located on the Control Panel for every module in your XAMPP. Click on the Admin button of your Apache server to go to the web address of your web server. The Control Panel will now start in your standard browser, and you'll be led to the dashboard of your XAMPP's local host.

Where is localhost in XAMPP?

In the basic configuration of XAMPP, phpMyAdmin is accessible only from the same host that XAMPP is running on, at http://127.0.0.1 or http://localhost. Before you can access the MySQL server, phpMyAdmin will prompt you for a user name and password.


3 Answers

Delete that file(index.php), you will get the list of directories and files from htdocs folder.

like image 80
Pujan Shah Avatar answered Sep 21 '22 19:09

Pujan Shah


In the file /Applications/XAMPP/xamppfiles/etc/httpd.conf change this:

# Virtual hosts
# Include etc/extra/httpd-vhosts.conf

with this:

# Virtual hosts
Include etc/extra/httpd-vhosts.conf

Then, In the file /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf add with something like this:

<VirtualHost *:80>
    ServerName sbyc.byc.local
    ServerAlias sbyc.byc.local
    DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/byc-mineduc01-ges/app"
    <Directory "/Applications/XAMPP/xamppfiles/htdocs/byc-mineduc01-ges/app">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog "logs/sbyc.byc.local-error_log"
</VirtualHost>
like image 26
Miguel Carrasco Avatar answered Sep 19 '22 19:09

Miguel Carrasco


This:

header('Location: '.$uri.'/dashboard/');

Performs redirect to localhost/dashboard/

Everything works as expected, if you clear this file and put some text, like "Hello world", you should see it on http://localhost/

like image 29
Fisher Avatar answered Sep 19 '22 19:09

Fisher