# Local test with XAMPP fails with 404: "Requested resource is not available" (after install)

**URL:** https://discourse.getcockpit.com/t/local-test-with-xampp-fails-with-404-requested-resource-is-not-available-after-install/2932
**Category:** Support
**Created:** [February 11, 2024, 8:20am UTC](https://discourse.getcockpit.com/t/local-test-with-xampp-fails-with-404-requested-resource-is-not-available-after-install/2932 "2024-02-11T08:20:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sebastian\_berlin](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@sebastian\_berlin](https://discourse.getcockpit.com/u/sebastian_berlin)
#### Post date: [February 11, 2024, 8:20am UTC](https://discourse.getcockpit.com/t/local-test-with-xampp-fails-with-404-requested-resource-is-not-available-after-install/2932/1 "2024-02-11T08:20:37Z")

</div>

I get a 404 error after a successful installation.

1. calling `/install` (with no issues)

 ![1](https://canada1.discourse-cdn.com/flex030/uploads/getcockpit/original/2X/6/62c5b6a766e1035f4bd40871dc4761c80e3691a7.png)

1. Pushing the button `login now` will forward to `/` and it shows this:

![2](https://canada1.discourse-cdn.com/flex030/uploads/getcockpit/original/2X/5/5affb6da37d541230aa72098ee28be9856853096.png)

* * *

- It’s a fresh XAMPP installation (win)
- PHP v8.2.12 / Apache v2.4.58
- all required extensions are installed
- `mod_rewrite` is activated (php.ini)
- `AllowOverride All` (httpd.conf)
- all files are stored (also .htaccess)
- server/services restarted after file editing

* * *

This problem could be related to:

- [Redirected to auth/login with 404 after install · Issue #686 · agentejo/cockpit · GitHub](https://github.com/agentejo/cockpit/issues/686)  
or
- [nginx config? · Issue #19 · agentejo/cockpit · GitHub](https://github.com/agentejo/cockpit/issues/19)

(…but I couldn’t find a solution for my case.)

* * *

Note: I’ve already published my issue on [GitHub](https://github.com/Cockpit-HQ/Cockpit/issues/173), but maybe there’s an idea in the community here. Thanks a lot!

---

<div class="post-metadata">

### Author: ![ffiesta](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/ffiesta/32/1428_2.png) [@ffiesta](https://discourse.getcockpit.com/u/ffiesta)
#### Post date: [February 22, 2024, 11:37pm UTC](https://discourse.getcockpit.com/t/local-test-with-xampp-fails-with-404-requested-resource-is-not-available-after-install/2932/2 "2024-02-22T23:37:30Z")

</div>

Hi,

You need to use a **pretty url** in my test only work when I access through [http://cockpit.xampp/](http://cockpit.xampp/) pretty url.

1. On Windows change or add the \<“httpd-vhosts.conf\>” file in “C:\xampp\apache\conf\extra” folder to

```auto
<VirtualHost *:80>
    ServerAdmin webmaster@cockpit.xampp
    DocumentRoot "C:/xampp/htdocs/cockpit"
    ServerName cockpit.xampp
    ErrorLog "logs/cockpit.xampp-error.log"
    CustomLog "logs/cockpit.xampp-access.log" common
</VirtualHost>

```

1. add `127.0.0.1 cockpit.xampp #xampp magic!` to host file in c:\Windows\System32\drivers\etc\hosts.

Voila,

---

<div class="post-metadata">

### Author: ![luislobo9b](https://avatars.discourse-cdn.com/v4/letter/l/87869e/32.png) [@luislobo9b](https://discourse.getcockpit.com/u/luislobo9b)
#### Post date: [September 26, 2024, 1:36pm UTC](https://discourse.getcockpit.com/t/local-test-with-xampp-fails-with-404-requested-resource-is-not-available-after-install/2932/3 "2024-09-26T13:36:33Z")

</div>

I had the same problem and fixed it by correcting the APP\_BASE URL in the code. I also made a Pull Request on GitHub, but that’s it:

index.php

line 82:  
$APP\_BASE = trim(str\_replace($APP\_DOCUMENT\_ROOT, ‘’, $APP\_DIR), “/”);

line 82 after:  
$APP\_BASE = ltrim(trim(str\_replace($APP\_DOCUMENT\_ROOT, ‘’, $APP\_DIR), “/”), “\”);
