M
M
misc12016-08-16 22:57:43
Apache HTTP Server
misc1, 2016-08-16 22:57:43

Apache giving away JS in CP1251?

For unknown reasons, Apache serves all files except JS in UTF-8, and JS in CP1251.
This is written in .htaccess:

AddDefaultCharset utf-8
AddCharset utf-8 .css .js
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]

But it doesn't help. What can be done in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nazar Mokrinsky, 2016-08-16
@misc1

Try adding encoding as header (mod_headers needs to be enabled):

<ifModule mod_headers.c>
  Header set Content-Type application/javascript; charset=utf-8
</ifModule>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question