XAMPP localhost redirects to localhost/dashboard
Asked Answered
U

9

14

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?

Uncaredfor answered 22/10, 2015 at 14:55 Comment(0)
I
8

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

Invaluable answered 22/2, 2016 at 6:49 Comment(1)
For people visiting in the future, follow this to get 'index of' page when hitting localhostSubastral
L
4

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>
Lafreniere answered 24/8, 2019 at 2:46 Comment(0)
F
3

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.

Fishbein answered 23/7, 2021 at 5:48 Comment(0)
N
2

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/

Nolin answered 23/10, 2015 at 7:21 Comment(1)
Yes, that is true, but how can I get to the XAMPP start page where I can set password for MYSQL database. Typing localhost/security/xamppsecurity.php gives an Object not found Error 404...Uncaredfor
A
1

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/.

Alimony answered 19/6, 2017 at 16:54 Comment(0)
A
0

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.

Arleenarlen answered 27/11, 2017 at 18:29 Comment(0)
A
0

Thanks to janh in .htaccess file change

RewriteRule . /index.php [L]

to

RewriteRule . /your_folder_name/index.php [L]

So .htaccess file will be like this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /your_folder_name/index.php [L]
</IfModule>
Antiscorbutic answered 18/5 at 12:6 Comment(0)
F
-1

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>
    
Faeroese answered 21/6, 2019 at 6:50 Comment(0)
P
-1

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

Presnell answered 6/10, 2020 at 20:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.