Server
Configuring server-side technical options, security, and SEO in OpenCart 4
Introduction
The Server tab contains technical settings that affect the security, performance, and SEO of your OpenCart installation. These options interact directly with your web server and should be configured with care.
Accessing Server Settings
Configuration Fields
Below are the key fields found in the Server tab:
Maintenance & SEO
Maintenance Mode: Set to Yes to prevent customers from browsing your store while you are making updates. They will see a "Maintenance" message instead. Logged-in administrators can still see the storefront.
Use SEO URLs: Set to Yes to enable friendly URLs (e.g.,
/iphoneinstead of/index.php?route=product/product&product_id=42).
Performance
Compression Level: GZIP compression level (0-9). Higher levels reduce the amount of data sent to the browser but use more CPU resources. A setting of
4or5is usually balanced.
Error Handling
Display Errors: Set to No on live production sites to prevent technical details from being visible to customers.
Log Errors: Set to Yes to record system errors in a file for troubleshooting.
Error Log Filename: The name of the file where errors are saved (default is
error.log).
Security Risk: Never set Display Errors to "Yes" on a live store. This can expose sensitive server information to malicious users.
Common Tasks
Enabling Maintenance Mode
When you need to perform updates or changes without customers seeing errors:
Navigate to the Maintenance & SEO section.
Set Maintenance Mode to Yes.
Click Save. Your store will now display a maintenance message to everyone except logged-in administrators.
Activating SEO Friendly URLs
To make your URLs look professional and improve search rankings:
Set Use SEO URLs to Yes.
Crucial Step: You must rename the file
htaccess.txtin your OpenCart root directory to.htaccess.Ensure each product, category, and information page has a unique SEO URL (Keyword) assigned in its respective "SEO" tab.
Best Practices
SEO & Performance
Optimization Tips
SEO URLs: After enabling this, ensure your
.htaccessfile is correctly configured in your root directory.Compression: GZIP compression can significantly improve your Google PageSpeed score by reducing the size of HTML, CSS, and JS files.
Maintenance & Security
Safe Updates
Maintenance Mode: Always enable this when performing major theme updates or installing new extensions to avoid customer errors during the process.
Error Logs: If your store is acting strangely or showing a white page, the first place to check is the Error Log (found in Maintenance → Error Logs).
Troubleshooting
SEO URLs are not working (404 Error)
.htaccess and Server Config
Check .htaccess: Ensure you have renamed
htaccess.txtto.htaccess.Apache Rewrite: Verify that your web server has the
mod_rewritemodule enabled.RewriteBase: If your store is in a subfolder (e.g.,
yourstore.com/shop/), you may need to edit.htaccessand setRewriteBase /shop/.Keyword Uniqueness: Ensure the SEO keyword you are using is not already taken by another product or category.
The Store is showing a "White Page" (Blank)
Error Diagnostics
Enable Error Logging: Ensure Log Errors is set to Yes.
Check Error Logs: Go to System → Maintenance → Error Logs to see the specific PHP error causing the crash.
Display Errors: Temporarily set Display Errors to Yes (only on a development site) to see the error directly on the screen.
"The Server settings are the protective walls and high-performance engine of your store. Balancing security with speed ensures a safe and fast experience for your users."
Last updated