Home page 404s when URL filter set for pages

Post Reply
kotep
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
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

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

About "/" at end of url from Nibbleblog
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
kotep
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]

</IfModule>
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
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

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

https://demo.bludit.com

and check if works ?

Thanks
Post Reply