Home page 404s when URL filter set for pages

Post Reply
Jr. Bludit
Posts: 2
Joined: Sat Jan 05, 2019 10:22 pm

I noticed this first on my site, but then downloaded a copy of Bludit to run locally and found that the issue existed there too.

If I set a URL filter for Pages (for example, "/post/" to make the URLs the same as my old Nibbleblog URLs) the home page gives me a Page Not Found error. This happens on all the themes I tested it on (Blog X, Blue and Alternative). This also happens whether my home page is the default list of recent posts, or a custom page.

The problem seems to be that $WHERE_AM_I is "page" when on the homepage while a URL filter is set, instead of "home" like it is when the URL filter is left empty.
User avatar
Site Admin
Posts: 2073
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich

I think it's the problem discussed and solved here:

About "/" at end of url from Nibbleblog
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
Jr. Bludit
Posts: 2
Joined: Sat Jan 05, 2019 10:22 pm

I tested it both on my localhost and on my public site, by editing the .htaccess to this:

Code: Select all

AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>

# Enable rewrite rules
RewriteEngine on

# Base directory
RewriteBase /bludit/

#These lines added
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]

RedirectMatch 301 /tag/(.*)/ http://localhost/bludit/tag/$1
RedirectMatch 301 /page/(.*)/ http://localhost/bludit/$1

# Deny direct access to the next directories
RewriteRule ^bl-content/(databases|workspaces|pages|tmp)/.*$ - [R=404,L]

# All URL process by index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [PT,L]

I saw no change in the bug, no matter whether I visited my website's root with a trailing slash or without. The home page seems to be unable to call setWhereAmI('home'); in url.class.php when I have a URL filter for pages.
User avatar
Site Admin
Posts: 739
Joined: Sat May 16, 2015 2:53 pm

the name of the filter is "page" for the WhereAmI.
Can you try to do the same changes in the demo ?


and check if works ?

Post Reply