This sounds confusing but isn’t. Here is the problem:
- application is hosted at http://www.site.com/app
- in /app, there’s a htaccess rerouting any non-existing files or directories to index.php
- index.php does
$method = end(explode('/',$_SERVER['REQUEST_URI']));and calls it method - now, method could be CSS, so CSS routine needs to take the css file and replace any
url(images/withurl(http://site.com/app/images
The problem is “guessing” http://site.com/app/images, because REQUEST_URI can range anywhere from the cleanest site.com/images and up to the dirtiest http://ex.gau.mit.edu/~jonas/site/projects/2012/app/ignoredmethod/more/ignored/methods/css
Without specifying the script URL, how can I guess the images folder URL?
SCRIPT_NAMEwill be really useful here.Usage: