Jump to content

How to use alias in Apache in order for php files to recognise the new paths.


g_p_java

Recommended Posts

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!!!

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.