I have made an application (php, css, js) with absolute path like
<img src="/images/example.jpg" alt=""/>
and others for including resources (js, css, etc.)
The application was initially destinated to be hosted on a server like http://domain.com Now I need to host the site in a subfolder http://domain.com/2013/
How can I update my application and make it accessible in the new subfolder without update all the paths.
Maybe with .htaccess ?
Or you can to try this code in you .htaccess:
RewriteEngine on
RewriteRule ^(.*)$ /2013/$1 [QSA,L]
Setting the base href should solve your problem. The following should be placed in the <head>
element of all your pages:
<base href="http://domain.com/2013/" />