# Subpages not working on local server after migration

**URL:** <https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525>\
**Category:** Questions\
**Tags:** v3\
**Created:** [June 15, 2020, 6:17am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525 "2020-06-15T06:17:03Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmpan](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bmpan](https://forum.getkirby.com/u/bmpan)\
**Post date:** [June 15, 2020, 6:17am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/1 "2020-06-15T06:17:03Z")

</div>

Hi,  
we have a company website developed with Kirby 2 running perfectly since years.

We have also a local test installation of that site. The server specification is  
Windows Server 2016, Apache 2.4.33, PHP 7.4.7  
Has been running perfectly until last week. I moved the installation folder to another location on same server, because this server is going to be our fileserver in future. I changed the path in apache httpd.conf to the new location.

**Problem**  
I can see the start page, but no subpages.

**What I already tried**  
I checked the troubleshooting advices and have been reading every forum post regarding “subpages”, “mod\_rewrite”, “.htaccess”, “rewrite base” etc. etc.  
So I moved the installation back to a similar folder like before (I had deleted the original one). No success.  
I took the original Kirby 2.5.12 starterkit with original .htaccess  
No success

**Detailed Information**  
Kirby starterkit 2.5.12 now located in D:\Test\kirby-fresh-starterkit  
httpd.conf entry is:

```
Alias /kirby-starterkit "D:\Test\kirby-fresh-starterkit"

<Directory "D:\Test\kirby-fresh-starterkit">
AllowOverride All
Require ip 192.168.115 

# Für PHP 
Options +ExecCGI
</Directory>

```

Server name is apollo1, so when I go to [http://apollo1/kirby-starterkit/](http://apollo1/kirby-starterkit/)  
I see the startpage and even those 3 images below the project A to project C blocks.

Apache log says

```
192.168.115.23 - - [15/Jun/2020:07:38:26 +0200] "GET /kirby-starterkit/ HTTP/1.1" 200 4099
192.168.115.23 - - [15/Jun/2020:07:38:29 +0200] "GET /kirby-starterkit/assets/css/index.css HTTP/1.1" 200 17894
192.168.115.23 - - [15/Jun/2020:07:38:29 +0200] "GET /kirby-starterkit/thumbs/projects/project-b/room-600x600.jpg HTTP/1.1" 200 62337
192.168.115.23 - - [15/Jun/2020:07:38:29 +0200] "GET /kirby-starterkit/thumbs/projects/project-a/creative-tools-600x600.jpg HTTP/1.1" 200 88271
192.168.115.23 - - [15/Jun/2020:07:38:29 +0200] "GET /kirby-starterkit/thumbs/projects/project-c/camera-600x600.jpg HTTP/1.1" 200 83599

```

etc. so all the stuff from subdirectories is 200 OK

When I go to [http://apollo1/kirby-starterkit/projects/project-a](http://apollo1/kirby-starterkit/projects/project-a) I get in Firefox:

```
Not Found
The requested URL /Test/kirby-fresh-starterkit/index.php was not found on this server.

```

and in apache log

```
192.168.115.23 - - [15/Jun/2020:08:00:19 +0200] "GET /kirby-starterkit/projects/project-a HTTP/1.1" 404 235

```

however,

```
http://apollo1/kirby-starterkit/thumbs/projects/project-a/creative-tools-600x600.jpg

```

is displayed with no error.

**Assumption**  
Must be an issue with directory rights or apache configuration. mod\_rewrite is working.

Isn’t it so that the following lines from .htaccess

```
# make site links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

```

render all subpage accesses back down to the main index.php?

Browser keeps telling me

```
The requested URL /Test/kirby-fresh-starterkit/index.php was not found on this server.

```

for any subpage, but it is definitely present.

Apache httpd.exe service runs under SYSTEM account;  
in the install folder D:\Test\kirby-fresh-starterkit the user SYSTEM has full read/write access.

Any ideas?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 15, 2020, 6:57am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/2 "2020-06-15T06:57:29Z")

</div>

> [@bmpan](#):
>
> Kirby 2.5.12

It seems to be a rewrite issue, because index.php should not appear in the URL if rewriting is enabled. On a side note, maybe not related, PHP 7.4 support was only added with Kirby 2.5.13, so you would have to update.

Please also note that security support for Kirby 2 will end Dec 31, 2020.

---

<div class="post-metadata">

**Author:** ![bvdputte](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bvdputte/32/8179_2.png) [@bvdputte](https://forum.getkirby.com/u/bvdputte)\
**Post date:** [June 15, 2020, 6:57am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/3 "2020-06-15T06:57:31Z")

</div>

> [@bmpan](#):
>
> PHP 7.4.7

I think you need 2.5.13 for PHP 7.4 support: [Release 2.5.13 · getkirby-v2/kirby · GitHub](https://github.com/getkirby-v2/kirby/releases/tag/2.5.13)

---

<div class="post-metadata">

**Author:** ![bmpan](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bmpan](https://forum.getkirby.com/u/bmpan)\
**Post date:** [June 15, 2020, 7:38am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/4 "2020-06-15T07:38:04Z")

</div>

Yes, I am aware that we should go to Kirby 3. It’s an issue of time… the docs talking of “nearly everything” must change on a Kirby 2 \> Kirby 3 migration. I also didn’t find really helpful information (pricing) about upgrading our license.

I have also Kirby 3 starterkit installed in D:\Test\kirby-starterkit-master  
The corresponding httpd.conf entry is

```
Alias /kirby-master "D:\Test\kirby-starterkit-master"
<Directory "D:\Test\kirby-starterkit-master">
AllowOverride All
Require ip 192.168.115 

# Für PHP 
Options +ExecCGI
</Directory>

```

and when I go to [http://apollo1/kirby-master/](http://apollo1/kirby-master/)

I see the startpage but no images, only black boxes.

Apache log says

```
"GET /kirby-master/ HTTP/1.1" 200 5346
"GET /kirby-master/media/pages/photography/trees/3506294441-1591947940/monster-trees-in-the-fog-1024x1024.jpg HTTP/1.1" 404 236
"GET /kirby-master/media/pages/photography/sky/3495650138-1591947940/dark-forest-1024x1024.jpg HTTP/1.1" 404 236
"GET /kirby-master/media/pages/photography/mountains/1173080142-1591947941/probably-photoshopped-1024x1024.jpg HTTP/1.1" 404 236
"GET /kirby-master/media/pages/photography/ocean/3567208724-1591947940/island-from-above-1024x1024.jpg HTTP/1.1" 404 236
"GET /kirby-master/media/pages/photography/waterfall/2577458037-1591947941/the-fall-is-lava-1024x1024.jpg HTTP/1.1" 404 236
"GET /kirby-master/media/pages/photography/desert/357164395-1591947941/indiana-jones-1024x1024.jpg HTTP/1.1" 404 236
"GET /kirby-master/assets/css/index.css HTTP/1.1" 200 2508

```

Note the 200 OK for the index.php and the css file, but 404 for the image stuff.

Going to [http://apollo1/kirby-master/photography/trees](http://apollo1/kirby-master/photography/trees) results again in

```
The requested URL /Test/kirby-starterkit-master/index.php was not found on this server.

```

in Firefox and

```
"GET /kirby-master/photography/trees HTTP/1.1" 404 236

```

in Apache log.

@texnixe I feel it it is a httpd.conf issue; unfortunately I have no backup of the working version.  
I never had to touch

```
# RewriteBase /

```

for the local installations. If I uncomment this line, it shows me content from C:\Apache24\htdocs (we have some intranet stuff there).

---

<div class="post-metadata">

**Author:** ![bvdputte](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bvdputte/32/8179_2.png) [@bvdputte](https://forum.getkirby.com/u/bvdputte)\
**Post date:** [June 15, 2020, 7:47am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/5 "2020-06-15T07:47:54Z")

</div>

Hi,

I agree with @texnixe here that your problem is most probably a server misconfiguration or a redirect gone wrong. I don’t have an answer for that unfortunately.

What I noticed is you use PHP 7.4, which is not supported in the kirby version you use (which might or might not be related to your issues). There are 2 possibilities here:

- downgrade server php version to meet kirby 2.5.12 requirements
- upgrade kirby 2.5.12 to 2.5.13 (nobody talking about a major version upgrade to Kirby 3 here)

Success!

---

<div class="post-metadata">

**Author:** ![bmpan](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bmpan](https://forum.getkirby.com/u/bmpan)\
**Post date:** [June 15, 2020, 8:00am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/6 "2020-06-15T08:00:36Z")

</div>

Ok, switched back to PHP 7.2.7 that worked before.  
No change, either in Kirby 2 or Kirby 3 starterkit.

PS. I have now Kirby 2.5.12, Kirby 2.5.13, Kirby 3 and my own website installed parallel. None of them working. Error is always “index.php not found”, but only for subpages.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 15, 2020, 10:07am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/7 "2020-06-15T10:07:17Z")

</div>

If it was running until last week, then you obviously made changes to your configuration that result in this failure.

- Make sure that rewriting is really enabled
- Make sure the `.htaccess` is picked up (if you add some rubbish, that should result in an error)
- Try setting the RewriteBase

---

<div class="post-metadata">

**Author:** ![bmpan](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bmpan](https://forum.getkirby.com/u/bmpan)\
**Post date:** [June 15, 2020, 10:47am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/8 "2020-06-15T10:47:18Z")

</div>

@texnixe We are coming closer.  
.htaccess is picked, also for subpages. I made the rubbish test.

But: index.php is only picked for the startpage. I enabled Apache debug logging by the “LogLevel debug” switch in httpd.conf

For any subpage, I get now (in Apache error.log)

> File does not exist: C:/Apache24/htdocs/Test/kirby-starterkit2513/index.php

This is apache default directory, while my installation is in:

> D:\Test\kirby-starterkit2513

Something must be wrong with my Directory directives in the httpd.conf

---

<div class="post-metadata">

**Author:** ![Adspectus](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/adspectus/32/189_2.png) [@Adspectus](https://forum.getkirby.com/u/Adspectus)\
**Post date:** [June 15, 2020, 11:11am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/9 "2020-06-15T11:11:47Z")

</div>

Could you post your complete httpd.conf or make it available somehow?

---

<div class="post-metadata">

**Author:** ![bmpan](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bmpan](https://forum.getkirby.com/u/bmpan)\
**Post date:** [June 15, 2020, 11:30am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/10 "2020-06-15T11:30:14Z")

</div>

[httpd.conf](http://data.pantron.de/httpd.conf)

---

<div class="post-metadata">

**Author:** ![Adspectus](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/adspectus/32/189_2.png) [@Adspectus](https://forum.getkirby.com/u/Adspectus)\
**Post date:** [June 15, 2020, 1:25pm UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/11 "2020-06-15T13:25:35Z")

</div>

Thanks, I will have a look into it.

Meanwhile, you could enable rewrite logging by using

```
Loglevel info rewrite:trace1

```

which raises the Loglevel to trace1 for the rewrite module only (while lowering it to info for the rest).

The rewrite module is logging its actions only if you raise the Loglevel higher than debug (i.e. "trace1), but it would be sufficient to raise it for the rewrite module only. You can go until trace8. See [this part](http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#logging) of the Apache2 Docs about rewriting. You will find the rewrite log entries by its prefix `[rewrite` in the log file.

---

<div class="post-metadata">

**Author:** ![bmpan](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bmpan](https://forum.getkirby.com/u/bmpan)\
**Post date:** [June 15, 2020, 2:15pm UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/12 "2020-06-15T14:15:16Z")

</div>

Thank you @Adspectus, thats a great way. Now I have tons of lines in my logfile, proving that rewrite is running fine.

When I go to the projects link in the 2…5.13 starterkit, I see the following:

```
pass through D:/Test/kirby-starterkit2513/assets/fonts/montserrat-700.woff, referer: http://apollo1/kirby-starterkit2513/assets/css/index.css
strip per-dir prefix: D:/Test/kirby-starterkit2513/projects -> projects, referer: http://apollo1/kirby-starterkit2513/
applying pattern '^content/(.*)\\.(txt|md|mdown)$' to uri 'projects', referer: http://apollo1/kirby-starterkit2513/
strip per-dir prefix: D:/Test/kirby-starterkit2513/projects -> projects, referer: http://apollo1/kirby-starterkit2513/
applying pattern '^site/(.*)' to uri 'projects', referer: http://apollo1/kirby-starterkit2513/
strip per-dir prefix: D:/Test/kirby-starterkit2513/projects -> projects, referer: http://apollo1/kirby-starterkit2513/
applying pattern '^(kirby|panel\\/app|panel\\/tests)/(.*)' to uri 'projects', referer: http://apollo1/kirby-starterkit2513/
strip per-dir prefix: D:/Test/kirby-starterkit2513/projects -> projects, referer: http://apollo1/kirby-starterkit2513/
applying pattern '^panel/(.*)' to uri 'projects', referer: http://apollo1/kirby-starterkit2513/
strip per-dir prefix: D:/Test/kirby-starterkit2513/projects -> projects, referer: http://apollo1/kirby-starterkit2513/
applying pattern '^(.*)' to uri 'projects', referer: http://apollo1/kirby-starterkit2513/
rewrite 'projects' -> 'index.php', referer: http://apollo1/kirby-starterkit2513/
add per-dir prefix: index.php -> D:/Test/kirby-starterkit2513/index.php, referer: http://apollo1/kirby-starterkit2513/
trying to replace context docroot D:\\Test\\kirby-starterkit2513 with context prefix /kirby-starterkit2513, referer: http://apollo1/kirby-starterkit2513/
internal redirect with D:/Test/kirby-starterkit2513/index.php [INTERNAL REDIRECT], referer: http://apollo1/kirby-starterkit2513/
AH00128: File does not exist: C:/Apache24/htdocs/Test/kirby-starterkit2513/index.php, referer: http://apollo1/kirby-starterkit2513/

```

The third-last line “trying to replace context docroot” looks suspicioius. I dont’ have such line accessing the startpage.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 15, 2020, 2:32pm UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/13 "2020-06-15T14:32:57Z")

</div>

> [@bmpan](#):
>
> `C:/Apache24/htdocs/Test/kirby-starterkit2513/index.php`

Here we suddenly end up in C:/…

---

<div class="post-metadata">

**Author:** ![Adspectus](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/adspectus/32/189_2.png) [@Adspectus](https://forum.getkirby.com/u/Adspectus)\
**Post date:** [June 15, 2020, 3:11pm UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/14 "2020-06-15T15:11:48Z")

</div>

I have not tested it but I would suggest to change two things:

1. Use always slashes instead of backslashes in your file paths even if you are on windows

2. Use the RewriteBase in all your sites .htaccess files (where applicable) to match your Alias, i.e. for the starterkit2513, use

---

<div class="post-metadata">

**Author:** ![bmpan](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bmpan](https://forum.getkirby.com/u/bmpan)\
**Post date:** [June 16, 2020, 7:58am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/15 "2020-06-16T07:58:25Z")

</div>

Thank you @Adspectus, this is the point.

> [@Adspectus](#):
>
> Use always slashes instead of backslashes in your file paths even if you are on windows

I replaced all backslashes by slashes in the **Alias** directives, and in the \<Directory\> directives, although it is not mandatory here. All my test installations working now.

Maybe this could be an issue for the Kirby troubleshooting / broken subpages section in the docs. I know there are many webservers supported by kirby, but in case of Apache I think this is an important hint.

---

<div class="post-metadata">

**Author:** ![Adspectus](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/adspectus/32/189_2.png) [@Adspectus](https://forum.getkirby.com/u/Adspectus)\
**Post date:** [June 16, 2020, 8:14am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/16 "2020-06-16T08:14:15Z")

</div>

I am pleased to hear that!

In fact, the RewriteBase directive should not be necessary because the rewrite engine is supposed to recognize aliased directories. However it seems that the rewrite engine can not find the correct base when using Alias with backslashes instead of slashes.

---

<div class="post-metadata">

**Author:** ![bmpan](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bmpan](https://forum.getkirby.com/u/bmpan)\
**Post date:** [June 16, 2020, 9:17am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/17 "2020-06-16T09:17:38Z")

</div>

I tested also the rewrite directive, but it does not accept absolute paths on Windows e.g. D:\Test…  
It supports only relative paths, and this means always relative to the Apache base “htdocs” path.

---

<div class="post-metadata">

**Author:** ![Adspectus](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/adspectus/32/189_2.png) [@Adspectus](https://forum.getkirby.com/u/Adspectus)\
**Post date:** [June 16, 2020, 9:37am UTC](https://forum.getkirby.com/t/subpages-not-working-on-local-server-after-migration/18525/18 "2020-06-16T09:37:05Z")

</div>

Yes, the RewriteBase directive needs an URL-path, thats why it should contain the first parameter of the Alias directive, not the second (in case it is needed at all).

See also: [http://httpd.apache.org/docs/2.4/mod/mod\_rewrite.html#rewritebase](http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#rewritebase)
