Welcome! Log In Create A New Profile

Advanced

Redirect js.map , css.map

Posted by neodjandre 
Redirect js.map , css.map
November 01, 2018 12:58PM
I am receiving multiple 404 errors for .map files which do not exist in my server logs. e.g.

/wp-includes/js/tinymce/skins/lightgray/skin.min.css.map
/wp-content/plugins/cornerstone/assets/dist/js/site/cs-head.js.map
/wp-content/plugins/cornerstone/assets/dist/js/site/cs-body.js.map

These files do not exist but I believe Chrome is asking for them when I am developing, hence the 404 errors in my logs.

How could I set up a redirect on Nginx so that files ending in css.map and js.map which do not exist, are redirected to a blank file called 404.map

In Apache I think this can be achieved as follows:

RewriteEngine On
Options +FollowSymlinks

# Prevent 404 Not Found for javascript/css source maps
RewriteCond %{REQUEST_URI} (\.map)$
RewriteRule (.*) 404.map [QSA]
Re: Redirect js.map , css.map
November 06, 2018 01:07AM
hi .
i have a problem .
how to install X-Accel-Redirect on the nginx in the directadmin ?

please help me !
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 107
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready