10
votes

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?

8

8 Answers

5
votes

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

2
votes

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/

1
votes

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>
0
votes

Have you checked that your .htaccess file is properly configured? This is what solved the problem for me. RewriteEngine is ON and your RewriteBase should be specified, so if your website directory is within the htdocs folder your RewriteBase should be /MyWebsite/.

0
votes

I too got the same problem.

Always when I try to access the file created in the htdocs, it was getting redirected to localhost/dashboard.

What I did was, I checked all the files present in htdocs. There was a file applications. I opened it and found that it was actually redirecting me to the dashboard.

So, I moved that file from htdocs.

I could access my files from htdocs now without any redirection issues.

0
votes

I have same problem and after some experiments I found decision. The problem was in .htaccess file, which located in root folder of my site folder. Content of .htaccess file:

RewriteEngine on
# If a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward it to index.php
RewriteRule . /index.php

When I remove slash before index.php in last row:

RewriteRule . index.php

My site home page opened normally.

-1
votes

As usually problem:

  • wp_config.php at your local file -wp_option after your importing your database
  • vhost.txt at xampp/apache/conf/extra/httpd-vhosts.conf

    <VirtualHost *:80>
           DocumentRoot "C:/xampp/apps/magento/htdocs"
           ServerName sitename.local
    </VirtualHost>
    
-1
votes

I had the same problem, I fixed it by removing the file named index in htdocs. Since that was redirecting me to the dashboard.