Post by steveking198 » Tue Jul 21, 2015 1:38 am

Hi All,

I'm working on my first Opencart project and I'm trying to make the urls with ?route= a bit nicer such as /index.php?route=checkout/cart becoming just /cart

I've added some rows to the url_alias table and if I go directly to /cart it works but I'm trying to work out how to generate the links to be consistent E.g. the links in the top nav

I've found answers on how to do this for older versions of Opencart but not for 2.x

I've looked in catalog/controller/common/seo_url.php as that's where people modified the older version to accomplish this but I don't understand why it's looking for $this->request->get['_route_'] when the url variable is just route without the underscores

Any help would be appreciated

Newbie

Posts

Joined
Mon Jul 13, 2015 3:52 am

Post by yodapt » Tue Jul 21, 2015 1:43 am

Open your htaccess and you will find out the why of _route_

Code: Select all

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

Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com


User avatar
Active Member

Posts

Joined
Fri Jun 17, 2011 6:39 pm


Post by steveking198 » Tue Jul 21, 2015 3:35 am

Thanks, got it working now :)

Newbie

Posts

Joined
Mon Jul 13, 2015 3:52 am
Who is online

Users browsing this forum: No registered users and 13 guests