0

I am building a joomla website on a live server and had to download the whole thing locally to work while without internet connection.

I am facing the following problem :

<img src="/images/photos/thumbnails/Topothesia.jpg">

does appear normally on the live server, while in the wamp environment fails to load

i can fix it in the wamp server by changing it to :

<img src="http:/localhost/sitename/images/photos/thumbnails/Topothesia.jpg">

Both pages have (in case its relevant)

<base href="http://***live site or localhost***/en/foo/bar" />

I understand it has something to do with how each (apache?) server handles relative or absolute links, but I need a way to make the local wamp server act like the live one in order to work.

Any ideas on how to handle it?

Thanks in advance.

krasatos
  • 1,177
  • 3
  • 13
  • 26

1 Answers1

0

You could add an additional line to the end of your .htaccess file on your local WAMP install to automatically redirect images links locally to proper sub-directory of your root localhost website.

RewriteRule ^images/(.*)$ /sitename/images/$1 [R=301,NC,L]

* EDIT *

I found some links for setting up multiple hosts on WAMP server, although not directly related; the process does configure WAMP to properly read URL paths locally for both SEF and file references.

https://www.virendrachandak.com/techtalk/creating-multiple-virtual-websites-in-wampserver/
http://www.codeforest.net/multiple-virtual-hosts-in-wamp
http://viralpatel.net/blogs/how-to-setup-multiple-virtual-hosts-in-wamp/

Virendra
  • 2,560
  • 3
  • 23
  • 37
Brian Bolli
  • 1,873
  • 1
  • 12
  • 14
  • Sounds promising Brian, will check it out. I am not very familiar with htaccess functions. Wont this command actually affect all images ? I am afraid it will mess all other images genericly rendered by joomla? For instance the language switching flags that are in another folder. – krasatos Apr 19 '14 at 10:14
  • You are correct it would affect all images. I actually had to use WAMP on a Windows development box myself and was able to get all the image paths working without the need for RewriteRule. I'll edit answer with some links. – Brian Bolli Apr 24 '14 at 00:31