Page 1 of 2
Bludit V.2.2.1 - Post page gives 404
Posted: Mon Feb 26, 2018 7:40 pm
by Alyona
Hi!
I have recently uploaded bludit to my hosting, moved posts from Nibbleblog (manually, thanks goodness I had not so many posts). Then I spend a lot of time to add a proper redirect (as result I made just post to post 303 redirect in htaccess). As result blog worked for few hours, but then I got 404 error on single post page
And I can't figure out where is problem.
Code: Select all
2018-02-26 15:54:17.654889 [NOTICE] [213.100.168.131:50305] [STDERR] (2.2.1) (/bludit/rashod-gaza-v-holodnoe-vremmya) buildPage | Error occurred when trying build the page from file with key:
I have already tried:
- reinstall bludit and moved all content (with one new post there weren't any errors, but after content upload I got same 404)
Does anyone have any ideas where could be problem?
Re: Bludit V.2.2.1 - Post page gives 404
Posted: Mon Feb 26, 2018 7:56 pm
by Edi
What is in your .htaccess?
Re: Bludit V.2.2.1 - Post page gives 404
Posted: Tue Feb 27, 2018 11:09 am
by Alyona
I have two .htaccess files - one in root directory and one in bludit folder.
The one from root directory
Code: Select all
RedirectPermanent /about_lpg_ru.html /about-lpg-ru.html
RedirectPermanent /about_lpg.html /about-lpg.html
RedirectPermanent /about_ru.html /about-ru.html
RedirectPermanent /cenas_ru.html /cenas-ru.html
RedirectPermanent /contact_ru.html /contact-ru.html
RedirectPermanent /downloads_ru.html /downloads-ru.html
RedirectPermanent /iekartas_ru.html /iekartas-ru.html
RedirectPermanent /index_ru.html /index-ru.html
RedirectPermanent /portfolioDarbi_ru.html /portfolioDarbi-ru.html
RedirectPermanent /blogs_ru.html /blog/
RedirectPermanent /files/padomi_lv.htm /index.html
RedirectPermanent /files/kontakti_lv.htm /contact.html
RedirectPermanent /index_lv.htm /index.html
RedirectPermanent /main1.php /index.html
RedirectPermanent /contactsLV.html /contact.html
RedirectPermanent /blogs.html /blog/
RedirectPermanent /eco.html /about-lpg.html
RedirectPermanent /eco-ru.html /about-lpg-ru.html
RedirectPermanent /calculatorRU.php /index-ru.html
RedirectPermanent /calculator.php /index.html
RedirectPermanent /softLV.php /downloads.html
RedirectPermanent /equipment.html /iekartas.html
RedirectPermanent /fsiSelectLV.html /direct-inject.html
RedirectPermanent /fsiGazLV.php /direct-inject.html
RedirectPermanent /fsiRU.html /direct-inject-ru.html
RedirectPermanent /fsiRU.php /direct-inject-ru.html
Redirect 301 /img/TECHINFO/MANUALS/ENG/EN_DiegoG3-Manual-2.0-r1.pdf http://www.autogaz.lv/downloads/diego/EN_3.0.8.0-30J-manual.pdf
Redirect 301 /img/TECHINFO/MANUALS/PL/PL_DiegoG3-Instrukcja.pdf http://www.autogaz.lv/downloads/diego/EN_3.0.8.0-30J-manual.pdf
ErrorDocument 404 /404.html
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
RewriteRule .* ? [F,L]
#rewritecond %{http_host} ^autogaz.lv [nc]
#rewriterule ^(.*)$ http://www.autogaz.lv/$1 [r=301,nc]
RewriteCond %{HTTP_HOST} !^www\.autogaz\.lv
RewriteRule (.*) http://www.autogaz.lv/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^.*/index\.html
RewriteRule ^(.*)index.html$ http://www.autogaz.lv/$1 [R=301,L]
# Disable directory browsing
Options -Indexes
# Disable Magic Quotes
<IfModule mod_php5.c>
php_flag magic_quotes_gpc off
</IfModule>
# Secure .xml files
<FilesMatch ".(xml)$">
Order Allow,Deny
Deny from all
</FilesMatch>
<Files "sitemap.xml">
Order Allow,Deny
Allow from all
</Files>
# Secure shadow.php
<Files shadow.php>
order allow,deny
deny from all
</Files>
# Secure keys.php
<Files keys.php>
order allow,deny
deny from all
</Files>
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>
FileETag none
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
And the one in Bludit folder
Code: Select all
AddDefaultCharset UTF-8
<IfModule mod_rewrite.c>
# Enable rewrite rules
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]
# Deny direct access to .txt files
RewriteRule ^bl-content/(.*)\.txt$ - [R=404,L]
# All URL process by index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [PT,L]
</IfModule>
Re: Bludit V.2.2.1 - Post page gives 404
Posted: Tue Feb 27, 2018 11:48 am
by Edi
Alyona wrote: ↑Tue Feb 27, 2018 11:09 am
And the one in Bludit folder
Code: Select all
AddDefaultCharset UTF-8
<IfModule mod_rewrite.c>
# Enable rewrite rules
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]
# Deny direct access to .txt files
RewriteRule ^bl-content/(.*)\.txt$ - [R=404,L]
# All URL process by index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [PT,L]
</IfModule>
The .htaccess that comes with Bludit is the following:
Code: Select all
AddDefaultCharset UTF-8
<IfModule mod_rewrite.c>
# Enable rewrite rules
RewriteEngine on
# Deny direct access to .txt files
RewriteRule ^bl-content/(.*)\.txt$ - [R=404,L]
# All URL process by index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [PT,L]
</IfModule>
Re: Bludit V.2.2.1 - Post page gives 404
Posted: Tue Feb 27, 2018 1:58 pm
by Alyona
Edi, you right. My fault (I was trying to fix redirect and add/remove "/" at the end of url). Just uploaded original .htaccess, but anyway I get same 404 error.
Re: Bludit V.2.2.1 - Post page gives 404
Posted: Tue Feb 27, 2018 2:29 pm
by Edi
Just to find out what causes the problem... Does it work, if .htaccess in the root directory is disabled?
Re: Bludit V.2.2.1 - Post page gives 404
Posted: Tue Feb 27, 2018 2:46 pm
by Alyona
No, it doesn't.
So far I was able to fix it in that way:
1. install bludit to bludit2
2. uploaded content of bl-content/pages, bl-content/upload
3. manually added entries to bl-content/database/pages.php
4. created a backup and copied it on FTP (download link from admin panel doesn't work)
5. restored backup in admin panel in Plugins->Backup
As result single post is displayed correctly. Still have no idea where was error.
Btw, maybe you have some working htaccess redirect code from Nibbleblog post page to Bludit page? There is difference in "/" in the end of URL, otherwise I have added same post titles, so URLs are the same. I tried
Code: Select all
RewriteEngine on
RewriteRule ^post/(.*)/$ /blog/$1 [R=301,NC]
but seems it doesn't work properly in all cases
Re: Bludit V.2.2.1 - Post page gives 404
Posted: Tue Feb 27, 2018 5:36 pm
by Edi
Really strange... Perhaps there is somewhere another .htaccess.
Alyona wrote: ↑Tue Feb 27, 2018 2:46 pm
but seems it doesn't work properly in all cases
In which cases?
There is also a thread about the trailing slash:
viewtopic.php?f=6&t=673
Re: Bludit V.2.2.1 - Post page gives 404
Posted: Tue Feb 27, 2018 6:30 pm
by Alyona
So the reason of my error most probably was some incorrect .htaccess? I should to take clear with them
For example now I have added new entry to .htaccess in bludit folder (actually it was renamed to /blog/)
Code: Select all
RewriteRule ^blog/post/(.*)/$ /blog/$1 [R=301,NC]
.htaccess tester (
https://htaccess.mwl.be) for link
Code: Select all
http://www.autogaz.lv/blog/post/rashod-gaza-v-holodnoe-vremya/
gives me correct result
Code: Select all
http://www.autogaz.lv/blog/rashod-gaza-v-holodnoe-vremya
But hosting gives 404 error for same link with error in log file
Code: Select all
(/blog/post/rashod-gaza-v-holodnoe-vremya/) buildPage | Error occurred when trying build the page from file with key: post/rashod-gaza-v-holodnoe-vremya/
Also I got 404 error when open blog/index.php
Re: Bludit V.2.2.1 - Post page gives 404
Posted: Tue Feb 27, 2018 11:42 pm
by Edi
Alyona wrote: ↑Tue Feb 27, 2018 6:30 pm
But hosting gives 404 error for same link with error in log file
Code: Select all
(/blog/post/rashod-gaza-v-holodnoe-vremya/) buildPage | Error occurred when trying build the page from file with key: post/rashod-gaza-v-holodnoe-vremya/
It seems that you have messed up something. Because there is already a slug /blog/ predefined at "Settings" > "Advanced" > "URL filters".
See the following thread:
viewtopic.php?f=6&t=1092
Also I got 404 error when open blog/index.php
Makes no sense. Bludit does not use some index.php.