---
title: "Using a Subdomain to store your images in OpenCart 1.5"
description: "NOTE: This article will only work for Opencart versions prior to 1.5.5.1. It does not work for versions 1.5.5.1 or newer. Google Page Speed recommends using a subdomain to store images that are..."
url: https://www.inmotionhosting.com/support/domain-names/using-a-subdomain-to-store-your-images-in-opencart/
date: 2012-02-02
modified: 2023-12-22
author: "Carrie Smaha"
categories: ["Domain Names", "OpenCart"]
type: post
lang: en
---

# Using a Subdomain to store your images in OpenCart 1.5

**NOTE:** This article will only work for Opencart versions **prior** to 1.5.5.1. It does not work for versions 1.5.5.1 or newer.

Google Page Speed recommends using a subdomain to store images that are loaded into your OpenCart store. When a web page tries to load images, scripts, and content they load one at a time. If you have a lot of images, it could dramatically impact your page load speeds. By having the images in a subdomain, they can load at the same time as the site does.

First, you’ll need to [create a subdomain](/support/) for the images in cPanel. During the set up of the subdomain  you’ll need to set the document root for the subdomain to the current folder where your images are stored. In this example, we set up the subdomain to images.inmotiontesting.com and pointed it to the existing image folder in the root folder of my OpenCart website.

Now, you have to edit the config.php file in the root of OpenCart as well as the config.php file in the admin folder:

**Change**:

```
define('HTTP_IMAGE', 'https://inmotiontesting.com/image/');
```

**To**:

```
define('HTTP_IMAGE', 'https://images.inmotiontesting.com/');
```

If you are using HTTPS, you’ll want to change the HTTP settings as well:

**Change**:

```
define('HTTPS_IMAGE', 'https://opencart.inmotiontesting.com/image/');
```

**To**:

```
define('HTTPS_IMAGE', 'https://images.inmotiontesting.com/');
```

If you want to test to make sure your changes have successfully worked, after you have made the changes above load your OpenCart site in a web browser. Then look at the source code to make sure all the image references are pointing to the subdomain. Here’s what our new source code looks like:

```

   
     
   

```

If you need further assistance please feel free to ask a question on our support center.
