vitaly Posted February 14, 2008 Share Posted February 14, 2008 Dear colleagues, I have the following directory structure: www.domain.com/projects/project1 www.domain.com/projects/project1/images www.domain.com/projects/project2 www.domain.com/projects/project2/images The problem is that inside HTML files image paths are specified using DocumentRoot /. This results in requests similar to: www.domain.com/images Obviously, this does not work, because images are located inside each project's own image folder: www.domain.com/projects/project1/images I would like to create a rule to solve this problem. I have tried the following: RewriteEngine on RewriteRule ^/$ /var/www/vhosts/pikkles.com/httpdocs/projects/fujichemical/astareal/beta/ [nc] However it does not seem to work. I have checked the paths and they are correct. What am I doing wrong? Thank you in advance. Vitaly Quote Link to comment Share on other sites More sharing options...
powerspike Posted February 15, 2008 Share Posted February 15, 2008 This to me seems like a couple of questions in one, but I'll try and answer the best I can. 1) if you are coding projects in sub directorys, that you'll need to either use the full path to the images folder, ie http://www.domain.com/project1/images/img.png. Or if you link to the image in your html like images/bob.png, it'll try and load "images/bob.png" using your current folder as the base. 2) You might want into looking into using virtual hosts and sub domains if you want it to act like a real website I.e bob.domain.com - project 1, joe.domain.com - project 2. I'm not sure if this helps you or not. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.