Problem with admin system check (server)

General questions about CMSimple
Post Reply
sbastian
Posts: 20
Joined: Tue May 17, 2016 11:17 am
Location: France
Contact:

Problem with admin system check (server)

Post by sbastian » Tue Dec 24, 2024 4:20 pm

Hello,
It seems to me that there is an incompatibility with the line of my .htaccess:
ErrorDocument 403 https://www.mysite.fr/userfiles/erreurs ... ur403.html (customization of the 403 page)
and the verification of the prerequisites in the admin menu / CMS / Information:

Vérification : './cmsimple/config.php' protégé en accès … Avertissement !
Vérification : './content/content.htm' protégé en accès … Avertissement !
Vérification : './templates/soluxiane-fr-responsive/template.htm' protégé en accès … Avertissement !
Vérification : './cmsimple/log.txt' protégé en accès … Avertissement !
Vérification : './cmsimple/debug-log.txt' protégé en accès … Avertissement !

the rest of the lines are OK
thanks for your advice
thanks

olape
Posts: 3317
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: Problem with admin system check (server)

Post by olape » Wed Dec 25, 2024 9:27 am

Hi,

You can simply test this.
The files are linked exactly at this point. Try to follow the links with your browser.
This is the easiest way to determine whether the warnings are justified.
If you cannot access the files with the browser, then everything is ok for now.

Your error page may not be returning the correct status (403).
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

sbastian
Posts: 20
Joined: Tue May 17, 2016 11:17 am
Location: France
Contact:

Re: Problem with admin system check (server)

Post by sbastian » Wed Dec 25, 2024 9:43 am

Hello,

I tested, as suggested, my 5 links and I have my customized 403 page for these 5 links.

So the warning is justified and does not prevent the proper functioning of my site, is it not?

Thank you for your advice. As the frame of the verification lines was not green but yellow, I had a doubt about the correct configuration of my site.

Thank you, and Merry Christmas!

olape
Posts: 3317
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: Problem with admin system check (server)

Post by olape » Wed Dec 25, 2024 10:10 am

sbastian wrote:
Wed Dec 25, 2024 9:43 am
I tested, as suggested, my 5 links and I have my customized 403 page for these 5 links.
Then this is ok.
But these error pages return the status 200.
This is wrong.
https://www.soluxiane.fr/userfiles/erre ... ur403.html must be 403

Code: Select all

<?php header("Status: 403 Forbidden"); ?>
https://www.soluxiane.fr/userfiles/erre ... ur404.html must be 404

Code: Select all

<?php header("Status: 404 Not Found"); ?>
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

olape
Posts: 3317
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: Problem with admin system check (server)

Post by olape » Wed Dec 25, 2024 10:30 am

or

Code: Select all

<?php http_response_code(404); ?>
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

sbastian
Posts: 20
Joined: Tue May 17, 2016 11:17 am
Location: France
Contact:

Re: Problem with admin system check (server)

Post by sbastian » Fri Dec 27, 2024 7:29 pm

Hi,
In conclusion, I deleted the line in my .htaccess file:

Code: Select all

ErrorDocument 403 https://www.mysite.fr/userf...etc...
...
The verification is now OK everywhere...
Too bad for my personalized file of the 403 error...

Thanks again and have a good evening.
Stéphane

olape
Posts: 3317
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: Problem with admin system check (server)

Post by olape » Sat Dec 28, 2024 10:01 am

Rename 403.html to 403.php and put the first line in the file:
olape wrote:
Wed Dec 25, 2024 10:30 am

Code: Select all

<?php http_response_code(403); ?>
Everything else can stay.
In the .htaccess you must of course refer to the 403.php.

You do the same with 404.
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

sbastian
Posts: 20
Joined: Tue May 17, 2016 11:17 am
Location: France
Contact:

Re: Problem with admin system check (server)

Post by sbastian » Sat Dec 28, 2024 10:11 am

Hello Olaf,

After several trials, I found that the problem remains the same whether 403.php or 403.html...
In fact, it is the location URL of my file 403.html that's the problem, and not the expression ErrorDocument 403.

In the file .htaccess file, to test, so I went from the expression :

Code: Select all

ErrorDocument 403 https://www.soluxiane.fr/userfiles/erreurs/403/erreur403.html

in the expression :

Code: Select all

ErrorDocument 403 https://www.soluxiane.net/erreurs/403/erreur403.html
...
soluxiane.net is another site, fictional, and quickly cobbled together, which serves as a test...

Checks cmsimple are now good, with my 5 lines which are in green with OK... and the links I get redirected to my page 403-personalized.

Now I'm going to see if I can keep my page erreur403.html in a directory that is going well in hosting the CMS.
I'll tell you the results of my investigations...

Good evening,
Stéphane

olape
Posts: 3317
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: Problem with admin system check (server)

Post by olape » Mon Dec 30, 2024 7:13 am

sbastian wrote:
Sat Dec 28, 2024 10:11 am
After several trials, I found that the problem remains the same whether 403.php or 403.html...
In fact, it is the location URL of my file 403.html that's the problem, and not the expression ErrorDocument 403.
The problem is the status of the page, not the name, not the path.
Whether html or php, the page must return the status 403.
But it returns 200.
You can check with Browserconsole.
Screenshot 2024-12-30 075053.png
But it should look like this.
Screenshot 2024-12-30 075252.png
The source code of your page should look like this:

Code: Select all

<?php http_response_code(403); ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="robots" content="index, follow">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>ERREUR 403</title>
        <style type="text/css">
            body {
                font-family: "Tahoma";
            }
        </style>
    </head>
    <body>
        <p style="text-align: center;"><img src="erreur403.png" alt="" width="720" height="540"></p>
        <p style="text-align: center;"><span style="font-size: 18pt; color: #3598db;"><em><strong><br>" Error 403   FORBIDDEN !  "</strong></em></span></p>
    </body>
</html>
If the page has the extension .htm or .html, you must ensure that it is executed as PHP.
It is easier if the page has the extension .php.

The same with 404.

The corresponding status is important for the search engines.
They do not only read the page, they also use the status.

The XH system check also uses the status.

Another simple way would be to create the pages in XH.
Described in the wiki for 404. https://wiki.cmsimple-xh.org/?tips-and- ... m-404-page
You do not have the required permissions to view the files attached to this post.
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

sbastian
Posts: 20
Joined: Tue May 17, 2016 11:17 am
Location: France
Contact:

Re: Problem with admin system check (server)

Post by sbastian » Wed Jan 01, 2025 8:38 pm

Hello,
I wish you a good year 2025, and a lot of success !

I think I have found the good solution...
here is the code of the php page :

Code: Select all

<?php http_response_code(403);?>
<?php
echo '<!DOCTYPE html>';
echo '<html>';
	echo '<head>';
		echo '<meta charset="UTF-8">';
		echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
		echo '<title>ERREUR 403</title>';
		echo '<style type="text/css"></style>';
	echo '</head>';
	echo '<body  style="font-family: Tahoma;">';
		echo '<div style="text-align: center;"><img src="erreur403.png" alt="" width="720" height="540"></div>';
		echo '<div style="text-align: center; font-size: 18pt; color: #3598db;"><em><strong>" Error 403   FORBIDDEN !  "</strong></em></div>';
	 echo '</body>';
echo '</html>';
?>
and here's the response of the browserconsole :
[ external image ]

This time I think to take a solution, but with remote files... too many error messages if the 403.php is local.

Good start to the year 2025 !

Stéphane
You do not have the required permissions to view the files attached to this post.

Post Reply