Htaccess Opencart for normal php pages that are not related to the store

Htaccess Opencart for normal php pages that are not related to the store

If you have your Opencart store in a folder of a domain, something like domain.com/store, you might have some issues with mode rewrite for other normal pages that are located in the root of your website.

What you need to know is that Opencart has its own htaccess file in its own folder. From there, you can add the mode rewrite code for the opencart store, it should contain something like this: (if the opencart store is located in the “store” folder.

1
2
3
4
5
6
7
8
RewriteBase /store/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

and in the htaccess from the root, something like this (for your normal php pages that you want to have mode rewrite):

2
3
RewriteEngine On
RewriteRule ^article-(.*)_(.*).html article_php.php?title=$1&&id=$2 [L]

Add a comment: