sruupl / batflat

Lightweight, fast and easy CMS for free. Bootstrap ready. https://batflat.org
MIT License
134 stars 54 forks source link

Admin dashboard #26

Closed piotr-placzek closed 5 years ago

piotr-placzek commented 6 years ago

Hello

I just downloaded the free batflat version from the project website.

Unfortunately, the admin directory contains only the index and htaccess files. There are no directories, therefore logging into the administration panel always results in the message NOT FOUND admin/dashboard .....

wilburforce83 commented 6 years ago

I came to ask about this too. I have just installed Batflat to try it out and after I log in I just get a 404, looked at the files and see there is only index and htaccess. Am I missing something simple? Thanks!

klocus commented 6 years ago

I think that you have an issue with mod_rewirte. Do you have Apache?

piotr-placzek commented 6 years ago

Yes. I am using the Apache/2.4.10 (Win32) OpenSSL/1.0.1h PHP/5.5.15

wilburforce83 commented 6 years ago

I didn't have https:// added so added that in, but still getting 404. I am not that great with php, so there is a good chance I am missing something here!

`

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ index.php [L] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://xxxxxxxxxxxxxxxxxxxx/$1 [R=301,L] `
klocus commented 6 years ago

@piotr-placzek @wilburforce83 do you have mod_rewrite enabled?

wilburforce83 commented 6 years ago

@piotr-placzek thanks for the quick reply, and sorry for my ignorance, I am still learning! I am hosting on a subdomain on Site Ground. They say that to enable mod_rewrite it needs to go in the .htaccess of the website.

https://www.siteground.com/kb/how_can_i_enable_modrewrite_module/

I have added this to the .htaccess in the /admin folder. Should it go in the subdomain .htaccess instead, or maybe even in the main domain /public_html/.htaccess?

i.e.

/public_html/.htaccess /public_html/subdomain/.htaccess /public_html/subdomain/admin/.htaccess

Many thanks for your help!

klocus commented 6 years ago

RewriteEngine On is already set in .htaccess file.

piotr-placzek commented 6 years ago

My mistake.

The rewrite_module was turned off.

However, now after giving login and password (admin / admin) in response I get a blank page (without any source code at all).

http://localhost/batflat-master/admin/dashboard/main?t=b88be7f58de0

klocus commented 6 years ago

Update PHP to 5.6 or 7 ;)

wilburforce83 commented 6 years ago

Okay, I have resolved mostly! I now have a 500 error on HTTPS, HTTP works fine, though I think I can fix that myself :) many thanks!!

klocus commented 6 years ago

@wilburforce83 enable "DEV_MODE" in inc/core/defines.php and check for errors.

wilburforce83 commented 6 years ago

@klocus Thanks, I have enable DEV_MODE to true. is there log somewhere? can't find anything obvious, thanks again for your help!

klocus commented 6 years ago

You should get some error instead of 500 page. Or maybe it's because of .htaccess protection. Try remove

# Prevent directory listings
Options -Indexes

# Prevent visitors from viewing files directly
<Files "\.(sdb|md|html|txt)$">
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
        Satisfy All
    </IfModule>
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
</Files>

from this file and check if that is working.

wilburforce83 commented 6 years ago

Okay, so if I manually remove the "s" everything works with no 500 errors, so it is all https:// related.

Removing the above code didn't do anything, is the https thing a simple fix that I'm missing?

klocus commented 6 years ago

Please use default Batlfat's .htaccess file. If you want use SSL, add

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

after Options -Indexes

wilburforce83 commented 6 years ago

@klocus thanks for this! I have done the changes but it hasn't done anyhting. However, I am on a subdomain, so sdo I need to write something different here:

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

To reflect that it is a subdomain?

klocus commented 6 years ago

It doesn't matter if you are on subdomain.

wilburforce83 commented 6 years ago

Thank you, I didn't think it would. I just can't get it to do anyhting other than home page in https:// everyhting works fine in HTTP:// but I need it secure.

This is what I have:

image

klocus commented 6 years ago
# Prevent directory listings
Options -Indexes

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# Prevent visitors from viewing files directly
<FilesMatch "\.(sdb\|html\|txt)$">
 <IfModule !mod_authz_core.c>
Order allow,deny
Deny from all
Satisfy All
</IfModule>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
</FilesMatch>

# URL rewrites
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(inc/\|themes/\|tmp/).*\.(php\|html)$ - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
</IfModule>
piotr-placzek commented 6 years ago

I just reinstalled Apache and updated everything. I changed the control panel from UwAmp to Xampp. And everything is ok. Thanks for your help and patience.

wilburforce83 commented 6 years ago

@klocus Thank you so much for all your help, but it still isn't working. I am wondering whether there is a problem with my host or something? I think I might just give up for the time being :(