Forum

Opencart rewrite rules

Patrick
7 November 2011, 17:18


Hiawatha version: 7.5
Operating System: Fedora 14

Hi Hugo,

I found a link somewhere on the website explaining how the rewrite rules worked, i.e. how to work them out yourself. Alas, I can't find it again so here I am being lazy and asking you for help...

How would the following translate into a Hiawatha rewrite rule:

RewriteBase /
RewriteRule sitemap.xml /index.php?route=feed/google_sitemap
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

It's in order to get clean URLs on an Opencart install. As always, any help will be very much appreciated.

Thanks,

Patrick
Hugo Leisink
7 November 2011, 18:51
UrlToolkit { 
ToolkitID = opencart
Match ^/sitemap.xml$ Rewrite /index.php?route=feed/google_sitemap
RequestURI exists Return
Match ^([^?]*)(\?(.*))? Rewrite /index.php?_route_=$1&$3
}

Please, let me know if it works. If so, I will add it to the HOWTO page.
Patrick
9 November 2011, 00:49
Thanks Hugo. I will test and feed back tomorrow. I feel quite stupid having to rely on you like this!

I work for a hosting company (well, that's one thing we do) and have successfully made Hiawatha our webserver of choice.
Hugo Leisink
9 November 2011, 07:15
You don't have to. Glad to help.

That's nice to hear! May I ask you to write a few words for the Opinions section at the About page?
Patrick
18 November 2011, 22:25
Hi again. Sorry for the delay Hugo. I'd be delighted to do a write-up!

I've not had chance to test Opencart properly yet. It's been a bit manic recently.
This topic has been closed.