Need some help with Apache .htaccess

Posted by Legend on Server Fault See other posts from Server Fault or by Legend
Published on 2010-04-01T15:13:33Z Indexed on 2010/04/01 15:23 UTC
Read the original article Hit count: 335

I am trying to setup an application that was built using the Zend framework. Let's say my subdomain is:

http://subdomain.domain.com

and that it points to the following:

http://www.domain.com/projectdir/

The structure of the project dir is the following:

application/
  ...
  ...
library/
  ...
  ...
public/
  ...
  ...
  .htaccess

The contents of the htaccess are:

SetEnv APPLICATION_ENV production

RewriteEngine On

# skip existing files and folders
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

# send everything to index
RewriteRule ^.*$ index.php [NC,L]

While this works, the child objects on the page are being directed to the domain i.e., the image URLs (and the CSS files etc.) are broken because they are being redirected to something like:

http://www.domain.com/images/image.png

Can someone please tell me how to fix this?

© Server Fault or respective owner

Related posts about apache

Related posts about .htaccess