Page 1 of 2

URL alias help?

Posted: Fri Jan 02, 2009 7:53 am
by wolphy
After two weeks of on and off ecommerce research I've decided that OpenCart has just about everything I'm looking for.  You guys have done an outstanding job of providing a sensible solution for small businesses!

I've got the default OpenCart 0.7.9-RC5 up and running and everything's looking pretty except some of the URLs.  I've set the "Use URL alias" in the admin panel to "Yes."  My .htaccess file is present and functioning properly.  Maybe I just don't know how to use the alias feature? 

Here is my test shop:

And this is what I typed into the URL Alias fields that didn't work:

URL Query:  category/path/3
URL Alias:          bracelets

Everything else is working great.

Let me know if you need more info...

Re: URL alias help?

Posted: Fri Jan 02, 2009 10:00 am
by Qphoria
There is a contrib to auto-generate the url alias for you, but the problem is that the changes from RC5 to RC6 are going to completely change the way they work, so I am reluctant to give that to you.

For now, you can see this for setting them up manually:

Re: URL alias help?

Posted: Fri Jan 02, 2009 11:04 am
by wolphy
Thanks for the quick reply!  I tried to do this manually, but it doesn't work.  This is what I've entered:

URL Query        controller=category&path=3

URL Alias          bracelets.html

but the original URL still shows up in the shop

Re: URL alias help?

Posted: Fri Jan 02, 2009 12:45 pm
by Qphoria
you are sure url alias is set to YES? It's not working as such

Re: URL alias help?

Posted: Fri Jan 02, 2009 9:40 pm
by wolphy
I was fiddling with it last night, so yeah, it wasn't set when I gave up, but it is now.  The automatic aliases are good-- but my manual changes don't show up.

Re: URL alias help?

Posted: Fri Jan 02, 2009 11:21 pm
by Qphoria
So you tried the autogenerator and it worked, and then you tried editing some of them to change them and they didn't change?

Re: URL alias help?

Posted: Fri Jan 02, 2009 11:27 pm
by wolphy
Autogenerator seems to work, but uses some URLs I don't like, such as: http://example.com/opencart_7.9/category/path/3.  When I try to change that to http://example.com/opencart_7.9/bracelets.html using the manual URL alias under the admin tab, like so:
query: controller=category&path=3  alias: bracelets.html
it doesn't work.

Re: URL alias help?

Posted: Sat Jan 03, 2009 12:34 am
by Qphoria
no no .. not the remastered urls.... there is an actual url generator contrib that converts:

url.com/cart/index.php?controller=account_create
to
url.com/cart/create-account.html

and
url.com/cart/index.php?controller=category&category_id=1
to
url.com/cart/bracelets.html

and
url.com/cart/index.php?controller=product&product_id=1
to
url.com/cart/Diamond-bracelet-1.html

But I'm currently reworking it to work for 0.7.9 RC6

Re: URL alias help?

Posted: Sat Jan 03, 2009 1:31 am
by wolphy
So is there no way to change the URLs I don't like in 0.7.9 RC5 without downloading the generator contrib?  And when might 0.7.9 RC6 be ready?  I'll be working on a client's store over the next couple of weeks and want to make sure we've got pretty URLs before going live.

Re: URL alias help?

Posted: Sat Jan 03, 2009 2:23 am
by Qphoria
Lets start over. Forget about the url generator for now. Just stick to manual entry.

1. setting url alias to "no", urls will be like this:
mysite.com/shop/controller=category&category_id=1

2. setting url alias to "yes" without any custom aliases, urls will be remastered like this:
mysite.com/shop/category/category_id/1

3. setting url alias to "yes" WITH custom aliases, urls will be like this:
mysite.com/shop/mycategoryname.html

But custom url aliases have to use the raw url format to work. The remastered url doesn't currently do a match for url alias.

So you can't do:
Query: category/category_id/1
Alias: mycategory.html

You have to use:
Query: controller=category&category_id=1
Alias: mycategory.html

Re: URL alias help?

Posted: Sat Jan 03, 2009 4:33 am
by wolphy
Okay.  Then I'm pretty sure I'm doing everything right.  I've got the url alias set to "yes"; and I'm using the raw url format for custom aliases.  Could something be configured wrong somewhere?

Re: URL alias help?

Posted: Sat Jan 03, 2009 4:53 am
by Qphoria
you are doing it right. Not sure why its not working.
did you uncomment the line in the .htaccess file that shows:

#RewriteBase /shop/
to
RewriteBase /opencart_7.9/

?

Re: URL alias help?

Posted: Sat Jan 03, 2009 5:11 am
by wolphy
here is the .htaccess file:

# Uncomment this to ensure that register_globals is Off
# php_flag register_globals Off

# URL Alias - see install.txt


RewriteEngine On

# Uncomment this if your URL is not directly related to the physical file paths.
# RewriteBase /shop/
RewriteBase /opencart_7.9/

#OPENCART REWRITES START
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L,QSA]
#OPENCART REWRITES END


Re: URL alias help?

Posted: Sun Jan 04, 2009 5:09 am
by wolphy
Anyone else know why this might not be working for me?  :(

Re: URL alias help?

Posted: Sun Jan 04, 2009 8:42 pm
by JNeuhoff
There are indeed some problems with the URL alias. I'll take a closer look at it as soon as I have some time.

Re: URL alias help?

Posted: Sun Jan 04, 2009 9:36 pm
by wolphy
Thanks for letting me know.  I really like OpenCart and plan to stick with it.  As a shopping cart newbie though I'm a little concerned with the PayPal issues I've seen discussed here (don't understand all the lingo, so I'm not entirely certain what the issues are).  My present client wants an exclusively PayPal shopping cart for her new site.  Are most of the PP kinks worked out, or am I making a bad decision to go OpenCart for this particular client?

Overall I think this is a fantastic os product!

Re: URL alias help?

Posted: Sun Jan 04, 2009 10:34 pm
by hm2k
JNeuhoff wrote: There are indeed some problems with the URL alias. I'll take a closer look at it as soon as I have some time.
If you do, ensure you check the SVN first, i've done a lot of updates to the URL aliasing recently to make them work far more smoothly, I think we're getting somewhere now.

Further details can be found here: http://code.google.com/p/open-cart/issues/detail?id=125

Re: URL alias help?

Posted: Sun Jan 04, 2009 11:57 pm
by Qphoria
yes. the latest svn version has perfect paypal. I stand by my code 100%. I spent 2 weeks on revamping it and it paid off

Re: URL alias help?

Posted: Mon Jan 05, 2009 2:27 am
by wolphy
Thanks all.

Q, I'm basically a designer, so have some intelligence shortcomings when it comes to programming lingo.  How do I use the SNV version for my client's site?  Is it a totally separate OpenCart version I have to install?  Please feel free to treat me like an idiot when responding...

Re: URL alias help?

Posted: Mon Jan 05, 2009 5:45 am
by Qphoria