K
K
KeyDel2016-12-13 14:29:33
Apache HTTP Server
KeyDel, 2016-12-13 14:29:33

The server adds an error message at the end of each page. How can I fix it?

Faced such a problem, the server swears at the directive in htaccess - RewriteRule ^(.*)$ index.php
Swears in such a way that at the end of each page it adds several sentences with the following content:

OK
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

but the rewrite itself is processed normally, all requests go to index.php
After adding the lines before RewriteRule ^(.*)$ index.php :
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

- on the main inscription about the error disappeared, but remained on the other pages.
This is the first time I've encountered such a problem. Tell me, what could be the matter and in which direction to dig?
Here is the content of htaccess:
AddDefaultCharset UTF-8
RewriteEngine on
ErrorDocument 404 /404
RewriteCond %{HTTP_HOST} ^site\.com$ [NC]
RewriteRule ^(.*)$ www.site.com/$1 [R=301,L]
RewriteCond %{SCRIPT_FILENAME} !\.(jpg|gif|png|ico|css|js|zip|rar|html|cur|pdf|xls|doc|ppt|ttf|otf|eot|woff|woff2|swf)$ [OR,NC]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !/robots.txt$
RewriteCond %{SCRIPT_FILENAME} !/sitemap.xml$
RewriteCond %{SCRIPT_FILENAME} !/favicon.ico$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-12-15
@alsopub

Try adding [L,QSA]:

...
RewriteRule ^(.*)$ index.php [L,QSA]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question