I currently have User SEO URL's
set to Yes in OpenCart Admin.
System -> Settings -> Store -> Server -> User SEO URL's
So far, all tags and SEO links are working; the command has done the desired effect.
However for the homepage and a few other links; how do I remove:
index.php?route=common/home
From the URL? Do I have to literally do a find and replace in the hardcode PHP files and risk upgrades or is there another way?
(without bloating performance i.e no poor amateur tools such as vQmod)
So, I'm using 1.5.5.1 and no one answer on this question solved my problem. However, combining the answers from @Jay Gilford, @TheBlackBenzKid and @rkaartikeyen I came up with a fully working solution.
Remember to enable seo urls as shown by @TheBlackBenzKid.
An explanation can be found below the code.
Apparently, @Jay Gilford and @TheBlackBenzKid solve the issue of the urls being properly written on the page.
But it seems to break the urls since the Controller can't find the pages and therefore reverts to the error page.
@rkaartikeyen's solution solves this problem by setting the current route to the requested route
I came late but my solution could be useful for others (tested on Opencart 2.0.3.1):
Open your MySQL console and run this query (change YOURDATABASE with your db name):
How it works:
The trick consists in adding a WHITE SPACE (' ') for the column "keyword", if you insert an empty string ('') this workaround doesn't work and the url rewriter will return again index.php?route=common/home.
I created a VQMOD for this. Free download here: http://www.opencart.com/index.php?route=extension/extension/info&extension_id=14683
Works well.
Jay's solution doesn't work for me, after editing I get blank screen. So I made a new one:
Put the line before:
Instead of after:
To remove
index.php?route=
from urls I simply recommend to edit.htaccess
file.Just add this:
I encounter no problems whatsoever. Just remember that you need to have RewriteEngine enabled. Look for this line:
RewriteEngine On
. If not present, past it before above code.I really like Victor Schröder's solution above for it's simplicity. Thanks! I created a vQmod based on his code mods in case it would be helpful to anyone. here is the code: