php - Need to change the routes on every route used in an app but don't want use to find/replace -
i'm working on modifying web-app.i not part of original development team (the ones made app), donated us.
bureaucracy reasons cannot make virtual host on server (the server ubuntu server (v15.*) using apache2) , bind subdomain (specially because don't own server on app runs). reason need make app run on folder within webroot folder (/var/www in case).
problem this:
completely , abosolutly routes used in app's code made assuming put directly in webroot directory example:
include 'includes/header.phhp'; include_once 'includes/encode.php';
that in php. involves html sources like:
<link rel='icon' href="imagenes/favicon.png" type="image/png" />
and inside javascript code:
url: '/js/reservas/src/php/wizardsubmit.php',
as expected server try find resources within root directory so: http:address.com/imagenes/favicon.png (using html image source shown above) , fail so, because there intermediate directory (the app directory in webroot) correct address find resource be: http:address.com/appdirectory/imagenes/favicon.png.
as can imagine title, don't want depend on finding , replacing each of routes in code because it's huge (even using linux facilities grep , sed) , take me forever.
is there way solve programmatically, using php callback server append complete route?
it may not clear, developers didn't create , less use "$this->basepath" variable, can't depend on because in same way have write on code.
using <base>
tag in page browser know directory make relative requests to