Virtuemart Images Disappear When You Move Joomla Directory

May 28, 2013

This is one of those niggling little problems I had this week. I usually build a Joomla site in a temporary directory of the domain it is going live on then move it to the root directory once the site launches. The normal process involves changing the temporary location in the Joomla configuration file and if you’re running Virtuemart e-commerce, change the directories in Virtuemart’s configuration file too, then move the site to the root directory.

However this week when I thought it had all gone smoothly, it appeared that secondary and additional product images were not showing up when enlarged. It turns out they were still being referenced in the old directory.

A look at the database told me that the full URL for the large version of secondary images/files had been coded into the database for every image meaning that when I moved the site, the URL’s were then pointing at empty locations.

There were two ways I could think of to solve this:

1. Use a redirect on the images directory. I just added this line at the end of the .htaccess file:

redirect 301 /temp_dir/components/com_virtuemart/shop_image/product/ http://www.domain.com/components/com_virtuemart/shop_image/product/

2. Use phpMyAdmin on your server and go through each row in the jos_vm_product_files table and edit to put the new location in the file_url field. If you’ve got a lot of images, this can take a while.

For the moment, both ways seem to work.

{ 2 comments… read them below or add one }

Jim Mooney July 29, 2013 at 3:40 am

Same thing happens when I import a Joomla 1.5 site to a local server for testing. All the images disappear. Must be a bug in a recent Joomla ver, because I don’t recall this happening before.

Prahmajankaya October 22, 2013 at 1:22 am

Hi. Just sharing this plugin for virtumart for one page checkout found at http://www.onepage-checkout.com

Leave a Comment

Previous post:

Next post:

microsoft search engines