I have installed a Zend Framework application in a subfolder, something like this:
www.mydomain.com/temp/zend-application/
Now the problem is all stylesheets, javascript files and also all links use relative paths, such as:
/css/styles.css
/js/jquery.js
/controller/action
And these go to the main domain like this:
www.mydomain.com/css/styles.css
www.mydomain.com/js/jquery.js
www.mydomain.com/controller/action
So how to make it work in that subfolder?
My .htacces file looks like this now:
RewriteEngine On
# Exclude some directories from URI rewriting
#RewriteRule ^(dir1|dir2|dir3) - [L]
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /public/index.php [NC,L]
EDIT: I have solved the problem by using setBaseUrl() method of front controller. Now the problem is how to edit my .htaccess file.