You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

XAMPP新版本localhost跳转dashboard,如何恢复目录显示及对应版本咨询

Hey there! I’ve dealt with this exact issue a bunch of times, so let’s walk through how to fix it and answer your questions about older XAMPP versions.

Fixing the Dashboard Redirect in Newer XAMPP Versions

The automatic jump to localhost/dashboard happens because XAMPP ships with a default index.php file in your htdocs folder, and Apache is configured to prioritize this file over showing directory listings. Here’s how to revert to the old behavior:

Option 1: Modify Apache’s Core Configuration (Permanent Fix)

  1. Navigate to your XAMPP installation directory, open the apache/conf/httpd.conf file in a text editor.
  2. Search for the DirectoryIndex line. It’ll look something like this:
    DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm ...
    
    Move index.php to the end of the list (or remove it entirely if you don’t need to prioritize PHP files as default homepages). This tells Apache to check for other index files first, and if none exist, show the directory listing.
  3. Next, find the <Directory "your-xampp-path/htdocs"> block, and make sure the line Options Indexes FollowSymLinks is not commented out (no # at the start). This line enables directory listing functionality.
  4. Save the file and restart Apache from the XAMPP Control Panel—your changes will take effect immediately.

Option 2: Quick Temporary Fix (Modify htdocs Files)

If you don’t want to mess with Apache configs, you can just rename or delete the index.php file in your htdocs folder. Without this default index file, Apache will fall back to showing the directory listing. Just keep in mind: if you add your own project’s index.php later, you’ll need to adjust this again.

Which Older XAMPP Versions Work With Just Deleting/Modifying index.php?

Before XAMPP introduced the official dashboard feature, the htdocs folder only had a simple welcome page (usually index.html or a basic index.php). Deleting or renaming that file would immediately trigger directory listings. These versions include:

  • XAMPP 5.x series
  • XAMPP 6.x series
  • XAMPP 7.0.x, 7.1.x, and 7.2.x series

Starting around XAMPP 7.3.x, the dashboard became the default setup, so deleting the index.php alone might not work (since Apache’s config still prioritizes PHP files, and sometimes the directory listing option was disabled by default). That’s why you need the config tweak mentioned above for newer versions.

Quick Troubleshooting Tip

If you’ve made the changes and still don’t see directory listings, check if there’s a .htaccess file in your htdocs folder. Sometimes this file overrides Apache’s core settings—look for lines like DirectoryIndex or Options -Indexes and comment them out (add a # at the start) if they’re blocking listings.

内容的提问来源于stack exchange,提问作者Alberto

火山引擎 最新活动