1. Home
  2. XML Sitemap Generator + AI Feed JSON + IndexNow PRO
  3. .htaccess Configuration

.htaccess Configuration

The .htaccess configuration gives your sitemaps and AI feeds clean, SEO-friendly URLs. Without these rules, sitemaps are still accessible via full OpenCart route URLs, but clean URLs are preferable for search console submissions and readability.

URL Mapping Reference

These are the rules the extension adds to your .htaccess:

Clean URLPurpose
/sitemap_index.xmlMaster sitemap index
/sitemaps/{lang}/product_sitemap_{n}.xmlPaginated product sitemaps
/sitemaps/{lang}/product_tags_sitemap_{n}.xmlProduct tag sitemaps
/sitemaps/{lang}/category_sitemap.xmlCategory sitemap
/sitemaps/{lang}/brand_sitemap.xmlBrand/manufacturer sitemap
/sitemaps/{lang}/information_sitemap.xmlInformation pages sitemap
/sitemaps/misc_sitemap.xmlMiscellaneous / custom links
/sitemaps/{lang}/journal3blog_sitemap.xmlJournal3 blog posts
/ai_feed_index.jsonAI feed manifest (index)
/ai-feed/{lang}/ai_product_feed_{n}.jsonPaginated AI product feed pages

{lang} = your language code (e.g., en, fr, de)
{n} = page number

Managing Rules from the Admin Panel

The extension provides three tools in the Settings tab → .htaccess Rules Configuration section:

Add Code to .htaccess File Reads your current .htaccess, removes any existing HB SEO rules, then inserts the latest rules in the correct position. A backup is automatically saved as .htaccess.sitemap.BACKUP before any write.

Remove .htaccess Rules Removes only the lines added by this extension. Your other .htaccess content is untouched. Reports how many lines were removed.

Manual .htaccess Setup

If your server does not allow PHP to write to .htaccess, copy the code block displayed in the admin panel and paste it into your root .htaccess file manually.

Where to place the rules: Place them after the OpenCart system/storage protection RewriteRule lines, but before the main OpenCart catch-all rule:

RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

Nginx Users

The extension generates Apache-specific rules. For Nginx, translate each RewriteRule into an equivalent location ~ regex block with a rewrite directive in your server config. Contact your hosting provider for assistance.

Troubleshooting

404 on sitemap URLs after adding rules:

  • Confirm mod_rewrite is enabled on your server
  • Confirm AllowOverride All is set for your web root in the Apache virtual host config
  • Check that the rules were actually written (open .htaccess in an FTP client and look for lines containing extension/hbseo/)

500 error after adding rules: Your server may have syntax restrictions. Remove the rules using the admin panel button and add them manually after reviewing the syntax.