Solution: Enabling SEO URLs Without FollowSymlinks
If your hosting provider does not support the FollowSymlinks directive (common in shared hosting environments due to security restrictions), you can still enable SEO-friendly URLs in OpenCart by using the SymLinksIfOwnerMatch directive or adjusting your .htaccess configuration. Here's how:
1. Verify Hosting Environment
Confirm with your hosting provider whether they allow:
SymLinksIfOwnerMatch (often supported as a secure alternative to FollowSymlinks).
.htaccess rules and mod_rewrite functionality.
2. Update .htaccess
If FollowSymlinks is not supported but SymLinksIfOwnerMatch is allowed, modify the .htaccess file in your OpenCart installation directory.
Updated .htaccess Example
Code: Select all
<IfModule mod_rewrite.c>
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?_route_=$1 [L,QSA]
</IfModule>
3. Enable SEO URLs in OpenCart
Log in to your OpenCart Admin Panel.
Go to System → Settings → Edit Store.
Under the Server tab, set Use SEO URLs to Yes.
Save your changes.
4. Test SEO URLs
Ensure that your .htaccess changes are working by visiting a product page. The URL should be SEO-friendly (e.g., yoursite.com/product-name instead of index.php?route=product/product&product_id=1).
If the URL doesn’t work, verify that mod_rewrite is enabled on your server.
5. If .htaccess or mod_rewrite is Disabled
If your provider does not support .htaccess or mod_rewrite, you have two options:
Switch Hosting Providers:
Choose a host that supports modern configurations (e.g., FollowSymlinks or SymLinksIfOwnerMatch).
This may be the easiest long-term solution if your hosting provider is restrictive.
Use Non-SEO URLs:
Keep SEO URLs disabled and focus on optimizing other aspects of your site for SEO.
6. Communicate with Your Host
Ask your hosting provider to enable SymLinksIfOwnerMatch if it’s not already enabled. Many providers are willing to make this adjustment upon request.
Example Request to Your Host:
Dear Support,
I am attempting to enable SEO-friendly URLs in my OpenCart store but have discovered that the FollowSymlinks directive is not supported on my hosting plan. Could you please enable the SymLinksIfOwnerMatch directive as a secure alternative? This will allow me to use SEO-friendly URLs without compromising server security.