Page 1 of 1
URL Aliases in latest version (0.7.8)
Posted: Sat Jul 12, 2008 2:56 pm
by aleks
Hi all, I just downloaded the latest version of OpenCart for a new website Im developing. The link is here
http://www.weareonfire.co.nz/kiwivelo/store/ and if you try and click on any of the products, the links dont work. This happens with the url aliasing on AND off in the admin. I havent changed any of the original opencart code. Kinda stuck at the moment. Can anyone give me some advice?
Thanks in advance.
Re: URL Aliases in latest version (0.7.8)
Posted: Sat Jul 12, 2008 3:43 pm
by bruce
Try removing the rewrite lines or the entire htaccess file and also turn off the url alias.
Re: URL Aliases in latest version (0.7.8)
Posted: Mon Jul 14, 2008 2:52 pm
by aleks
Thanks for the reply Bruce, however it didnt make it work. I removed the lines first and then tried removing the whole .htaccess file. Is there a way to just disable the url aliasing completely? Because I just want to get the link to work at at least when I click on them, url aliased or not..
Re: URL Aliases in latest version (0.7.8)
Posted: Mon Jul 14, 2008 4:56 pm
by bruce
You have to turn it off in the admin also
Re: URL Aliases in latest version (0.7.8)
Posted: Tue Jul 15, 2008 12:19 pm
by aleks
Yeah I tried turning it off in the admin too but it didn't work. Good news tho, I managed to disable the url aliasing in the controller file by commenting some code out. So the links work now, without the aliasing of course, but they work nonetheless. Thanks for your help and replies

Re: URL Aliases in latest version (0.7.8)
Posted: Tue Jul 15, 2008 6:33 pm
by SiteE@se
I've run into this issue on a test installation of 0.7.8 today. I just replaced url.php in library->environment with the version from 0.7.7 to get back to the standard urls and a working cart. Don't need friendly urls for the test site, which is just being used to experiment with templates.
Chris
Re: URL Aliases in latest version (0.7.8)
Posted: Tue Jul 15, 2008 6:56 pm
by hm2k
I probably didn't test this issue as much as I could have done.
I have a few tricks to resolve these issues, which i'll probably release as 0.7.8a once I get a little bit of time to play.
Re: URL Aliases in latest version (0.7.8)
Posted: Wed Jul 16, 2008 12:42 am
by SiteE@se
siteease wrote:
I just replaced url.php in library->environment with the version from 0.7.7 to get back to the standard urls and a working cart.
Please ignore that - it breaks the admin login .....
Chris
Re: URL Aliases in latest version (0.7.8)
Posted: Wed Jul 16, 2008 3:46 pm
by Kulsha
Hello
I'm having the same problem with pages not opening. Setting admin to no URL alias and deleting .htaccess doesn't work.
Can you tell me which controller file you edited and what code you commented out? I opened the url_alias.php file, assuming it might be that one but wouldn't have a clue what to comment out if its infact the right file to fiddle with.
Or any other easy fix if anyone could help please.
Thanks
Re: URL Aliases in latest version (0.7.8)
Posted: Thu Jul 17, 2008 1:29 am
by activeebiz
Here is how to be able to turn on and off url Aliases in admin for version (0.78)
In this file:
library/environment/url.php
change:
if (!preg_match('/\/admin\/index.php/',$_SERVER['PHP_SELF'])) {
to
if ((!preg_match('/\/admin\/index.php/',$_SERVER['PHP_SELF'])) && ($this->config->get('config_url_alias'))) {
After having done this change you can get turn off the use of url rewrites simply by going into your shops admin under
Admin >. Configuration >> Settings
and set
Use URL Alias: to "false" if you can't or simply dont want to use url rewites on your server/hosting set-up
And if you later on change your mind and want to use them, then its just to switch them to "on" again in the admin.
If you have them set to "on" then also make sure that you have a correctly set-up .htaccess file in your shops main folder.
Re: URL Aliases in latest version (0.7.8)
Posted: Thu Jul 17, 2008 9:47 am
by Kulsha
Thank you very much, I would never have known how to do this without your help. It all works fine now!

Re: URL Aliases in latest version (0.7.8)
Posted: Tue Jul 22, 2008 7:13 pm
by JNeuhoff
I came accross the same issues while testing the new OpenCart 0.7.8 and posted a summary on
http://code.google.com/p/open-cart/issues/detail?id=32 .
Notice that if you want URL Alias enabled, make sure also to include the 'RewriteBase' command in the '.htaccess' file:
Code: Select all
# Please ensure register_globals is Off by uncommenting this line
#php_flag register_globals Off
# URL Alias - see install.txt
Options +FollowSymlinks
<IfModule mod_rewrite.c>
RewriteEngine On
# Put your installation directory here:
# If your URL is www.example.com/shop/, use /shop/
# If your URL is www.example.com/, use /
RewriteBase /juergen/opencart-0-7-8/
#OPENCART REWRITES START
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php
#OPENCART REWRITES END
</IfModule>
Re: URL Aliases in latest version (0.7.8)
Posted: Fri Jul 25, 2008 9:11 pm
by activeebiz
After having looked over the url functions in 0.78 ... i have some suggestions for the next version based on some mods i have done on my dev site.
Remove the code which rewrites the urls to a format like this:
YOUR-SHOP_URL/product/product_id/3
Its has no real function and does not really present any advantage over the orginal urls like:
YOUR-SHOP-URL/index.php?controller=product&product_id=3
Most if not all of the major search engines will index and rank such url styles about the same.
The url which on the other hand provide an advantage has some relevant keywords in them ....
So providing use url aliases is set to true ... Then url aliases should be autogenerated for atleast products and categories.
Also if someone comes to your site via a link in the old url style , redirect them to the new rewritten url alias address.