htaccess - site with lots of /dir1/di2 - show image on root?

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
Consolas
Forum Newbie
Posts: 13
Joined: Wed Apr 09, 2008 7:07 pm

htaccess - site with lots of /dir1/di2 - show image on root?

Post by Consolas »

Hello

I didn't want to overcharge the other thread thus created this one.

Since I have a site running with htaccess and therefore a lot of rewrites ( site.com/dir1/dir2/dir3...) how can I have a root image (for instance) path?

I was using something like define('ROOT_PAHT',"/"); and then would place on each image the ROOT_PATH variable before the img/name_of_image.jpg path.

Tried "./" as well but I'm afraid the path will still be relative to the present url showing.

Is there a better way to do this? Do I need to create a subdomain just for the images? Like images.site.com and point that to the /img folder?

Thanks to all
Post Reply