g_p_java Posted May 28, 2010 Share Posted May 28, 2010 Hi, i have a web application which consists of php files and images. In my php files i have references to image files like this "../".$my_root_site."images/thumbs/". etc ... The problem is that i changed the path for my images folders and i have to replace each line of my php files with this "../../".$my_root_site."images/thumbs/". I have to add a ../ , because the php files cannot "see" my new path!!! I have a lot of files and i cannot modify all of my php files!!! I'm studying the apache documentations for alias and redirect but i don't know what i shall use. May you please advise me? Thanks, in advance!!! Link to comment https://forums.phpfreaks.com/topic/203181-how-to-use-alias-in-apache-in-order-for-php-files-to-recognise-the-new-paths/ Share on other sites More sharing options...
pornophobic Posted May 28, 2010 Share Posted May 28, 2010 If you're using a linux server you could create a symbolic link where your old images path was to your new one. If that solution won't work, and the URL to your images hasn't changed but the physical path on the machine has, you would use alias, I believe. I'm not as familiar with Apache as I am with lighty, but I believe you could just write in a htaccess file in your site root. Alias /images /filesystem/path/on/machine/to/site_root/images From what I understand you're trying to do, I would imagine that would help. Link to comment https://forums.phpfreaks.com/topic/203181-how-to-use-alias-in-apache-in-order-for-php-files-to-recognise-the-new-paths/#findComment-1064586 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.