I'm having some troubles figuring out how to get a rewrite rule I have in a .htaccess file ported over. The basic ones are working fine it's just the rule we have for dealing with requests for our CSS and image files from a relative path. Those files are kept in the folder "http://domain.com/includes/images/"; and "http://domain.com/includes/css"; and we use relative links to point to them.

When they hit a link for the contact page (http://domain.com/contact or just /contact ) there is an internal redirect that points to http://domain.com/index.php?id=contact
This is simple and working fine.

Where the trouble pops up is our includes as the browser is now looking for http://domain.com/contact/includes/images/logo.jpg instead of where it really is: http://domain.com/includes/images/logo.jpg In Apache we had this handles by the following rule which worked fine as it was only run once:
RewriteRule ^([a-z0-9-_./]+)/includes/([a-z0-9-_./]+)$ includes/$2

This does not work in Cherokee as it seems to keep running the rule over and over again till it spits out (external was selected to see output):
http://domain.com/contact/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/includes/images/logo.jpg

My question is whether this can be done without resorting to a rule per subpage or without having to to change our links to absolute links. The reason we don't want a rule per subpage is the web designers don't have access to cherokee-admin to add rules so it's best to have one or two rules that can handle having new pages thrown at it as well as pages getting removed. The reason absolute links aren't used is it's more efficient (or lazy, however you want to look at it) for doing testing and development before going live as well as allowing previews for clients.
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to