Do the RSS Feed and Sitemap plugins work with the PHP development server?

Post Reply
michaell
Jr. Bludit
Posts: 4
Joined: Mon Nov 13, 2023 11:38 pm
Been thanked: 1 time

Hello...

I'm trying out Bludit.

I'm running locally, using the PHP development server.

I've enabled the RSS Feed and Sitemap plugins.

When I visit http://localhost:8044/rss.xml I get:

"The requested resource /rss.xml was not found on this server."

When I visit http://localhost:8044/sitemap.xml I get:

"The requested resource /sitemap.xml was not found on this server."

I see the generated files under `bl-content/workspaces/rss` and `bl-content/workspaces/sitemap`; they just aren't served.

Am I doing something wrong?

Does the PHP development server not support serving those files for some reason?

Would I need to do something special on my Apache-based host to make them work?

Thanks,
Michael

P.S. I see that `robots.txt` isn't served either:

"The requested resource /robots.txt was not found on this server."
User avatar
Edi
Site Admin
Posts: 3148
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 64 times
Been thanked: 85 times
Contact:

Does your installation work beside this problems?
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
michaell
Jr. Bludit
Posts: 4
Joined: Mon Nov 13, 2023 11:38 pm
Been thanked: 1 time

Yes, everything else works.
User avatar
Edi
Site Admin
Posts: 3148
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 64 times
Been thanked: 85 times
Contact:

I have to look at it. I don't know if the files are created on the fly or copied from the directory /workspace.

What OS do you use for your PHP development server?
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
michaell
Jr. Bludit
Posts: 4
Joined: Mon Nov 13, 2023 11:38 pm
Been thanked: 1 time

I'm on a Mac.

As I said, I see the generated files. They just aren't being served by Bludit.

Maybe the expectation is that, as actual files, they'd be served directly by Apache?

The problem is that the generated files aren't in the root. I'd need to map logical paths to physical paths to get Apache to serve them. There aren't any such mappings in the default `.htaccess` though; that's why "served directly by Apache" didn't actually make sense to me.

If you think this *should* work using the PHP server, I can dig further. I just didn't want to waste time digging into an unsupported config.

Michael
User avatar
Edi
Site Admin
Posts: 3148
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 64 times
Been thanked: 85 times
Contact:

michaell wrote: Thu Nov 16, 2023 11:06 pm If you think this *should* work using the PHP server, I can dig further.
At the moment I have no local Mac installation. But it works on my websites. For example at

https://planet-bludit.ch/sitemap.xml
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
michaell
Jr. Bludit
Posts: 4
Joined: Mon Nov 13, 2023 11:38 pm
Been thanked: 1 time

OK, I dug into this a bit.

My conclusion is that the built-in web server won't work correctly without additional support.

The built-in web server is described here: https://www.php.net/manual/en/features. ... server.php.

It has very specific default behaviour.

You can change the default behaviour by passing a "router script" on the command-line, like this:

`php -S localhost:8000 router.php`

Here is `router.php` for Grav, another flat-file CMS: https://github.com/getgrav/grav/blob/de ... router.php

Here is `router.php` for Kirby, another flat-file CMS: https://github.com/getkirby/kirby/blob/main/router.php

Kirby's `router.php` is just 14 lines long. If I a) add it to Bludit and b) pass it on the command-line, the built-in server works as expected.

In other words, it serves `/robots.txt`, `/sitemap.xml`, etc.
User avatar
Romeo21
Ssr. Bludit
Posts: 10
Joined: Fri Nov 25, 2022 7:00 pm
Been thanked: 3 times

Thanks for the guide
Post Reply