modxbot / migrate

A testground for migrating issues and other such fun
0 stars 0 forks source link

minifier rewrite css urls with server path instead of url #7815

Open lexusburn opened 12 years ago

lexusburn commented 12 years ago

lexusburn created Redmine issue ID 7815

i have installed both revolution-2.2.1-pl and revolution-2.2.2-pl on my webserver. i am using symlinks because i have to directories (modx and modx_old) that referes to the revolution-2.2.2-pl dir and the revolution-2.2.1-pl dir.

My directory listing looks like this:

{HOSTNAME}/htdocs/modx -> ../modx
{HOSTNAME}/htdocs/modx_old -> ../modx_old
{HOSTNAME}/modx -> modx-2.2.2-pl
{HOSTNAME}/modx-2.2.2-pl
{HOSTNAME}/modx_old -> modx_old_versions/modx-2.2.1-pl
{HOSTNAME}/modx_old_versions/modx-2.2.1-pl

When i activate compress_css the manager fails to load some background-images that are referred in minified css files. This happens because the path in css files looks like this:

https://{HOSTNAME}/var/www/{HOSTNAME}/modx-2.2.2-pl/manager/templates/default/images/modx-theme/grid/page-last-disabled.png

My quick & dirty resolution for this is to disable CSS URL rewriting in minifier by changing

$min_serveOptions['rewriteCssUris'] = true;

to

$min_serveOptions['rewriteCssUris'] = false;

in manager/min/index.php

now i get the image path like this:

../images/modx-theme/grid/page-last-disabled.png

i added these mod_rewrite-hack in manager/.htaccess to rewrite this url:

RewriteEngine On
RewriteBase /modx/manager
RewriteRule ^images/(.*)$ /modx/manager/templates/default/images/$1 [L]

Can anyone help me to get another better resolution for this problem?

modxbot commented 11 years ago

bonflash submitted:

The same with revolution-2.2.5-pl. Some CSS URLs get rewritten to absolute file system paths.

Turning compress_css off resolves this, but I assume that such behavior is a bug.