Author Archives: jay

How to Update Moodle to Work with a New Domain

If you need to move your Moodle site to a new domain or make it accessible from a different URL, you must update its configuration settings. The key step is modifying the config.php file in Moodle’s main directory.

Step 1: Locate the config.php File

The config.php file is located in the root folder of your Moodle installation. You can access it via FTP, your hosting file manager, or SSH, depending on your setup.

Step 2: Edit the wwwroot Setting

Open config.php with a text editor. Look for the line that defines the site’s URL, which looks like this:

$CFG->wwwroot = 'http://olddomain.com';

Replace the old domain with your new domain name. For example:

$CFG->wwwroot = 'http://newdomain.com';

Make sure to use the correct protocol (http or https) based on your SSL setup.

Step 3: Save Changes and Clear Cache

After updating the URL, save the file and upload it back to the server if you edited it locally. Then, clear your browser cache to ensure Moodle loads from the new domain without issues.

Step 4: Verify the Site

Visit your new domain in a browser and check that your Moodle site loads correctly. Test a few pages and login to confirm all internal links now point to the new domain.

Important Notes:

  • If your Moodle site uses additional plugins or external integrations, make sure they also reference the new domain.
  • Back up your config.php file before making changes to avoid accidental misconfigurations.

By updating the $CFG->wwwroot value, your Moodle site will now function properly under the new domain, ensuring a smooth transition for your users.

Experience fast, secure, and reliable Moodle hosting with TrexHost—launch your site today and enjoy worry-free performance.

How to Adjust Product Image Quality in PrestaShop for Optimal Website Performance

PrestaShop, starting from version 1.4.4.1, offers store administrators the ability to manage the quality of their product images directly from the admin panel. This feature is valuable for those running large e-commerce websites, where high-quality images can sometimes impact loading speeds, especially if there are numerous products on display.

In this guide, we’ll walk you through the process of adjusting your product image quality in PrestaShop and explain how these changes can improve both image load times and overall website performance.

Step 1: Uploading Product Images

First, ensure you have your product images ready to upload. To do this, log in to your PrestaShop admin area, and navigate to:

Catalog > Products

  1. Choose the product you want to add or update images for.
  2. Open the Images tab within the product page.
  3. Here, you can browse and upload images for the selected product. You can upload multiple images for each product, which is great for showcasing different angles or variations.

Step 2: Adjusting Image Quality

Once your images are uploaded, it’s time to adjust their quality settings. This is done through the Preferences section in your admin panel.

Navigate to:

Preferences > Images

In this section, you’ll see options to modify the image quality for different formats. PrestaShop allows you to set quality values for JPEG and PNG formats, which are the most common file types used for product images.

  • JPEG Quality: You can adjust the quality from a range of 0 (lowest) to 100 (highest). Reducing the JPEG quality can result in smaller file sizes, but be mindful that too low of a quality setting may cause the images to appear pixelated or blurry.
  • PNG Quality: Similar to JPEG, PNG images can also be adjusted in terms of quality. However, unlike JPEG, PNG is a lossless format, meaning it retains more detail even at lower quality settings, although file sizes may remain relatively large compared to JPEG.

Step 3: Balancing Image Quality and Website Speed

When managing an online store, particularly one with many products, balancing image quality and performance is key. High-quality images can improve the user experience, but they can also slow down page load times, which affects SEO rankings and conversion rates.

  • Performance Considerations: For large stores with hundreds or thousands of products, it might be worthwhile to decrease image quality slightly to speed up loading times. While this may slightly reduce image sharpness, it can significantly boost your website’s overall performance.
  • Optimizing for Mobile Users: Remember that many users will visit your site on mobile devices, where slower connections are common. Lowering image quality without sacrificing too much visual appeal can lead to faster loading times, especially for mobile visitors.

Step 4: Regenerating Thumbnails

After adjusting the image quality settings, the final step is to regenerate your thumbnails. This process ensures that all previously uploaded product images are resized and optimized according to the new quality settings. To regenerate thumbnails:

  1. In the Images settings under Preferences, locate and click the button that says Regenerate Thumbnails.
  2. This will start the process, and PrestaShop will automatically resize all images according to your new settings.
  3. Depending on the number of products and images, this could take some time to complete, so be patient.

Step 5: Clear Your Cache and Check the Results

Once the regeneration process is finished, it’s essential to clear your browser’s cache to view the changes. To do this, simply:

  1. Clear the cache from your PrestaShop admin panel.
  2. Refresh your product pages to check the result.

By following these steps, your product images should load faster without sacrificing too much quality, leading to a more efficient and user-friendly website.

Final Thoughts

Adjusting image quality in PrestaShop is a simple yet effective way to improve website performance. Lowering image quality can significantly reduce file sizes, resulting in faster page loading times, which is particularly important for large online stores. However, it’s important to find a balance—ensure your images still look professional and appealing while optimizing for speed. With the right settings, you can achieve a great user experience without compromising on performance.

Launch your online store with TrexHost’s optimized PrestaShop hosting—offering blazing-fast speeds, free SSL, daily backups, and 24/7 support.

Why my website is loading slow?

In this article we will cover some of the reasons why your website loading is slow.

Unoptimized Images
A large volume of unoptimized images is usually the most common reason behind website slowness. High-resolution images can consume lots of bandwidth while loading. Uploading larger sized images and then scaling them down can unnecessarily increase the size of your web page – causing your website to load slowly.

The image format is another important factor to consider. For example, JPEG images are much smaller in size compared to other image formats like PNG or GIF. Quite naturally, your web page will load faster if you are using JPEG images instead of PNG/GIF.

Solutions:

– Check the file size of your images, anything above 1MB is really unacceptable.
– Use JPEG instead of PNG, especially for larger images. Icons are ok.
– Use waterfall tests to easily scan image sizes and take corrective action.

JavaScript Issues
The availability of JavaScript/jQuery plugins has made it really convenient to add dynamic content to websites. However, if implemented incorrectly, JavaScript can cripple your website’s page load speed.

Solutions:

– Audit your JavaScript scripts to see what you really need and remove the rest.
– Consider using something like Google Tag Manager – a single script for all your tools.

Excessive HTTP Requests
Having loads of JavaScript, CSS, and image files can lead to too many HTTP requests. When a user visits your web page, the browser performs several requests to load each of these files – which can significantly reduce the page load speed.

Solutions:

– Reduce the number of files on your pages where possible. Includes CSS, images, javascript.
– Minify your CSS and Javascript files reduces the number of total files users will have to download.

Not Making Use of Caching
Whenever you visit a website, certain elements are stored in a cache, so the next time you visit the site it can easily access those parts and load much faster. With caching, instead of your browser having to download every single resource, it only has to download a few of them.

By turning on caching you can considerably improve your site’s loading for return visitors. If you’re using a CMS like WordPress you can install a plugin like W3 Total Cache, either of which will let you enable sitewide caching, or caching of certain site elements.

Another great tool for speeding up dynamic database-driven websites is Memcached. Memcached reduces that load by storing data objects in dynamic memory.
For more details see the following articles as well:

– How to use Memcached? 
– How to Enable Memcached on WordPress? 
– How to Enable Memcached on Joomla ? 


Too Many Ads
No doubt display advertisements are great for monetizing your websites traffic.

But that shouldn’t come at the cost of compromised performance or user experience. Don’t let too many ads be another reason why your website is slow!

The most obvious impact of overloading your website with advertisements is the addition of HTTP requests, which would need additional processing time.

Especially the rich media ads – like pop unders, interstitials and auto downloads – may create hundreds of HTTP requests making your website unresponsive.

How To Enable SSL (HTTPs) for your website?

Website visitors are becoming more aware of the importance of secure data transfer, and they often look for the green lock that appears in their browser on HTTPs-enabled websites.

Before you can have your website loading at https:// instead of http:// you need to have SSL certificate installed for your domain.

You can get one from the hosting control panel -> My Domains -> SSL Certificates

The options are either to Order SSL certificate or Request Let’s Encrypt certificate.

Once you have installed the SSL, please allow up to 1 hour for the new SSL IP propagation!

After you have enabled SSL certificate on your domain name, you will need to set up a redirect for your website to use SSL and HTTPs protocol.

The procedure is valid for any static or dynamic website, which does not have a configuration for the URL it is installed on, like WordPress.

If you need to enable HTTPs for your WordPress site, please see the How To Enable SSL (HTTPs) in WordPress article.

First, go to Files -> File Manager in your hosting control panel and navigate to your domain root folder, usually /www/mydomain.com/

If there is no file called .htaccess created, then create one using the New File button.

Edit the .htaccess file and place the following code at the top:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Click Save.

Once you do this, your website is now fully setup to use SSL / HTTPS.

How To Enable SSL (HTTPs) in WordPress?

After you have enabled SSL certificate on your domain name, you will need to set up WordPress to use SSL and HTTPs protocols on your website.

We will show you two methods to do that, and you can choose one that best fits your need.

Method 1: Setup SSL/HTTPS in WordPress Using a Plugin

This method is easier and is recommended for beginners.

  1. Log into the WordPress Dashboard.
  2. Roll your mouse over Settings in the navigation menu, then click General.
  3. In the WordPress Address (URL) field, enter your https address.
  4. Enter your https address in the Site Address (URL)  field. 
  5. Click the Save Changes button on the bottom of the screen. 

Once the settings are saved, WordPress will log you out, and you will be asked to re-login.

Then, you need to install and activate the Really Simple SSL plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit Settings in the navigation menu, then click SSL. The plugin will automatically detect your SSL certificate, and it will set up your WordPress site to use HTTPs

The plugin will take care of everything including the mixed content errors. Here’s what the plugin does behind the scenes:

– Check SSL certificate
– Set WordPress to use https in URLs
– Set up redirects from HTTP to HTTPs
– Look for URLs in your content still loading from insecure HTTP sources and attempt to fix them.

Note: The plugin attempts to fix mixed content errors by using output buffering technique. It can have a negative performance impact because it’s replacing content on the site as the page is being loaded. This impact is only seen on first-page load, and it should be minimal if you are using a caching plugin.

Method 2: Setup SSL/HTTPS in WordPress Manually

This method requires you to troubleshoot issues manually and edit WordPress files. However this is a permanent and more performance optimized solution.

  1. Log into the WordPress Dashboard.
  2. Roll your mouse over Settings in the navigation menu, then click General.
  3. In the WordPress Address (URL) field, enter your https address.
  4. Enter your https address in the Site Address (URL)  field. 
  5. Click the Save Changes button on the bottom of the screen. 

Once the settings are saved, WordPress will log you out, and you will be asked to re-login.

Next, you need to set up WordPress redirects from HTTP to HTTPS by adding the following code to your .htaccess file.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

If you want to force SSL and HTTPS on your WordPress admin area or login pages, then you need to configure SSL in the wp-config.php file.

Simply add the following code above the “That’s all, stop editing!” line in your wp-config.php file:

define(‘FORCE_SSL_ADMIN’, true);

This line allows WordPress to force SSL / HTTPs in WordPress admin area

Once you do this, your website is now fully setup to use SSL / HTTPS, but you will still encounter mixed content errors.

These errors are caused by sources (images, scripts, or stylesheets) that are still loading using the insecure HTTP protocol in the URLs. If that is the case, then you will not be able to see a secure padlock icon in your website’s address bar.

Majority of the incorrect URLs will be images, files, embeds, and other data stored in your WordPress database.

All what you need to do is find all mentions of your old website URL in the database that started with http and replace it with your new website URL that starts with https.

You can easily do this by installing and activating the Better Search Replace plugin.

How to use Memcached?

The Memcached system is used by some of the most traffic heavy sites such as YouTube, Facebook, Twitter.

It is also supported by some popular CMSs such as Drupal, Joomla, and WordPress.

To use Memcached with PHP, please enable memcached extension from the control panel at Advanced -> PHP Settings -> Edit php.ini -> memcached On.

To have Memcached enabled your plan needs to have Memcached instances available. In case you need to add one or more, you can purchase it as an upgrade from the Add/Upgrade service(s) section in the hosting control panel.

Each instance goes with 16 MB of memory which is why the Memcached instances go with Memcached memory.

Important: many applications require host and port to link them with Memcached. On our system the Memcached works on a Socket instead of Port.

In this case you need to use

Memcached hostname(IP): unix:///home/sys/memcached.sock
Memcached Port: 0

Example: $memcached->addServer(‘unix:///home/sys/memcached.sock’, 0);

How to Enable Memcached on WordPress

In this guide, we’re going to use the free extension W3 Total Cache to configure WordPress with Memcached.

If you’re already using another extension such as WP Super Cache, you’ll need to deactivate this and install the W3 Cache in order to follow this guide.

Here are the steps to follow to configure W3 Total Cache with Memcached:

1. Sign in to your WordPress dashboard
2. In the main menu, go to Performance then click on General Settings
3.  Activate Memcached for the following options:

– Page Cache Method
– Minify Cache method
– Database cache method

-> Save the settings

For Memcached hostname:port / IP:port use: /home/sys/memcached.sock:0

Save the settings and you’ve successfully enabled memcached on your WordPress website.

How to Enable Memcached on Joomla

You can speed up your Joomla site by using memcached.

To enable memcached on Joomla, you need to modify a few settings in your Joomla configuration.php file first.

You can find this file in your Joomla site’s root folder. Using your favorite FTP software, edit this file and find the following lines:

public $caching = ‘0’;
public $cache_handler = ‘file’;

Change these lines to the following:

public $caching = ‘2’;
public $cache_handler = ‘memcache’;

Then, immediately after the two lines you edited, add these two lines:

public $memcache_server_host = ‘/home/sys/memcached.sock’;
public $memcache_server_port = ‘0’;

After you are done making all the changes, save the configuration file.

Configure Memcached in Joomla Settings

Now, we will configure memcached on our Joomla-based website.

Login to your Joomla site’s admin panel and navigate to System -> Global Configuration.

Click on the server tab at the top and scroll down to Cache Settings. From the drop-down menu select Persistent(Memcached).

Note: Make sure to enter the correct Memcached server host and port for your server.

Memcache(d) Server Host: /home/sys/memcached.sock
Memcache(d) Server Port: 0

Save the settings.

You’ve successfully enabled memcached on your Joomla website.

How to add SSL for my domain/subdomain – a step-by-step guide

SSL is used to secure the connection between your website and the customer’s computer. It is recommended when you have an online form which gathers personal or sensitive information from your website users, such as billing and registration details, for example.

Although it is not a definitive requirement to have SSL in such cases, it is a way to protect the data of your users and it is valued and even demanded by many customers.

To activate SSL for your domain (or subdomain) you need to install an SSL certificate for it. To be able to install SSL for any domain it must have a dedicated IP address. Learn how to get a dedicated IP in this article: How do I get a dedicated IP for my domain/subdomain?

Assuming that you already have a dedicated IP for your domain, here is what you must do to activate SSL:

Step 1: Purchase an SSL certificate
You can purchase an SSL certificate by going to My Domains > SSL Certificates > Order SSL Certificate button on your web hosting control panel. Input the following details in the order form:

CSR Details

Hostname: Select a domain name from the drop-down list for which you want to order a certificate.
Organization: Type in the exact legal name of your organization. Do not abbreviate the name of your organization. 
Organization Unit: Specify the exact department of your organization (optional).
Country: Select your country from the list.
City: Type in your city.
State: The state or province where your organization is legally located. It should not be abbreviated.
E-mail: Type in your personal e-mail address.

Note that none of the following characters can be used in the details: < > ~ ! @ # $ % ^ * / ( ) ?.,& 
 
Contact Info

All fields are pre-filled with the details you provided for your hosting account.

*If you choose to use a different hostname, you must select an “Approver E-mail” at the bottom, which must be an e-mail account hosted here (one created in the E-Mail Manager on your web hosting control panel).

Purchase Details

Choose a shared IP address or a dedicated IP for which the SSL certificate will be issue.

Select the registration period – 12 months.

Make sure you read the User Agreement and select the checkbox next to “Accept User Agreement“, then select a payment method and finally click on the “Continue” button at the right. You will be forwarded to a billing gateway page to submit the payment.

Once your payment has been submitted, you will be able to see your newly ordered certificate in My Domains > SSL Certificates menu in your web hosting control panel. As soon as the status is changed to “Active” you can apply the certificate to your domain.


Step 2: Install an SSL certificate

a) Install an SSL certificate purchased from us

Go to My Domains > SSL Certificates and find your domain (or subdomain) in the list (Domain column) and click on the View SSL Certificate link (Action column) on the right. On the new “SSL Certificate Configuration” popup window, select the domain for which you want to install the certificate.

After that you must select IP from the drop-down list.

When ready, press “Activate SSL certificate” button.
—————————————————————————————
b) Request Let’s Encrypt certificate

Go to My Domains > SSL Certificates and find your domain (or subdomain) in the list (Domain column) and click on the Add  SSL Certificate link (Action column) on the right. On the new “SSL Certificate Configuration” popup window, select the “Request Let’s Encrypt certificate” option.

After that you must select IP from the drop-down list.

When ready, press “Activate SSL certificate” button.

—————————————————————————————
c) Install an SSL certificate if you already have one

Go to My Domains > SSL Certificates and find your domain (or subdomain) in the list (Domain column) and click on the Add SSL Certificate link (Action column) on the right. On the new “SSL Certificate Configuration” popup window, select the option to “Upload SSL certificate” – as soon as you select this option, 3 text fields appear under the form:

Private key
SSL certificate
CA

After you fill in all fields, you must select IP from the drop-down list.

When ready, press “Activate SSL certificate” button.

If you have followed this tutorial strictly, now you should have SSL activated for your domain.

Can I use a domain name I registered with another company (registrar)?

When you register a domain name you reserve the name for a period of time (usually a year or two).

It is not necessary to have your domain name registered with the same company that would be hosting your website (and thus your domain).

However, you have to point the domain to your hosting space to make it work properly. This is done by applying your hosting company’s name servers to your domain name.

Inside the domain control panel provided by your registrar (the company you registered the domain with) you should have the option to change the name servers, which may also be referred to as NS or DNS change.

To properly host a domain registered with another company with us, you must:

  1. Add the domain to your Hosted Domains list (My Domains > Hosted Domains)
  2. Set our name servers for your domain
  3. Wait for the name server change to propagate (usually within 12-24 hours)

Additional information and instructions could be found in the following articles:
– How do I host a domain name?
– What are the correct name servers (DNS) for my domain?