Search code examples
javascriptregex.htaccesscentossource-maps

.htaccess causes fail in parsing source maps


On the web page the .htaccess is:

RewriteEngine On
RewriteBase /
Options -MultiViews
DirectorySlash Off

# skip POST requests
RewriteCond %{REQUEST_METHOD} POST
RewriteRule ^ - [L] 

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(.+?)/?$ /$1.php [L]

# redirect to .php-less link if requested directly
RewriteCond %{THE_REQUEST} ^[A-Z]+\s.+\.php\sHTTP/.+
RewriteRule ^(.+)\.php $1 [R=301,L]

Options All -Indexes

ErrorDocument 403 /img/error.php
ErrorDocument 404 /img/error.php
ErrorDocument 500 /img/500.png

It causes the next error:

Failed to parse SourceMap: .../js/bootstrap-select.js.map

When I delete it, the error doesn't occur. How should I modify .htaccess?


Solution

  • Solved the problem by changing error.php to a picture ( in error.php there was redirect to index page ).