[CubeCart] How do I redirect 301 (dynamic urls)

Custom URLs and redirections.
VonHelvete
Posts: 4
Joined: Mon Jun 02, 2008 5:10 pm

[CubeCart] How do I redirect 301 (dynamic urls)

Postby VonHelvete » Mon Jun 02, 2008 5:14 pm

I just can't get the rewrite 301 to work along with the seo mod cause I know more or less nothing about Apache.
I have tried for 3 days now but I can't get it work.

If I want to do an internal redirect 301 for example
THIS: http://www.domain.se/view_product.php?product=N811 TO: http://www.domain.se/panos-bikini-20/pa ... ia-17.html

How should I write it and exactly where ? Need to do this on every single page from the old site to the new to keep my position in google and so on!
Would be more than grateful if anyone could help me ... 3 days of reading yes I have learned a lot but not this =) It's the dynamic urls that makes it impossible for me to get it working....

Ps. If it's unclear I have a old Cubecart store version 2 without seo mod that I need to redirect permanent to the new CC version 3 that have totally different url's but still on same domain and same products.

Thanks in advance! :geek:
Magic SEO URLs for CubeCart

inveo
Inveo Support
Posts: 1273
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

[CubeCart] Re: How do I redirect 301 (dynamic urls)

Postby inveo » Mon Jun 02, 2008 5:30 pm

You will need to add following code for each link to the .htaccess file:

Code: Select all

RewriteCond %{QUERY_STRING} ^product=N811$
RewriteRule ^view_product.php$ index.php?act=viewProd&productId=17 [L,QSA]


Magic SEO URL then makes HTTP 301 redirects automatically.

VonHelvete
Posts: 4
Joined: Mon Jun 02, 2008 5:10 pm

Re: [CubeCart] How do I redirect 301 (dynamic urls)

Postby VonHelvete » Tue Jun 03, 2008 9:16 am

Awesome! And it will be permanent 301 from the old site on all urls I do like this with?
Same principe for everything like categories, products, documents and so on ? Just change the "dynamic" value depending on what I redirect, right?
You rules Jiri! ;)

inveo
Inveo Support
Posts: 1273
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [CubeCart] How do I redirect 301 (dynamic urls)

Postby inveo » Tue Jun 03, 2008 9:21 am

VonHelvete wrote:Awesome! And it will be permanent 301 from the old site on all urls I do like this with?

Yes, it will.
VonHelvete wrote:Same principe for everything like categories, products, documents and so on ? Just change the "dynamic" value depending on what I redirect, right?

Right.

VonHelvete
Posts: 4
Joined: Mon Jun 02, 2008 5:10 pm

Re: [CubeCart] How do I redirect 301 (dynamic urls)

Postby VonHelvete » Tue Jun 03, 2008 9:24 am

Awesome, but I must be stupid! Tried this on categories but it will not work?

Code: Select all

RewriteCond %{QUERY_STRING} ^cat_id=8$
RewriteRule ^view_cat.php$ index.php?act=viewCat&catId=30 [L,QSA]


What did I do wrong this time hehe ....

inveo
Inveo Support
Posts: 1273
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [CubeCart] How do I redirect 301 (dynamic urls)

Postby inveo » Tue Jun 03, 2008 10:25 am

This only works on web sites with Magic SEO URL installed. Please make sure your .htaccess file keep changes and is not overwritten.

VonHelvete
Posts: 4
Joined: Mon Jun 02, 2008 5:10 pm

Re: [CubeCart] How do I redirect 301 (dynamic urls)

Postby VonHelvete » Tue Jun 03, 2008 10:57 am

Hi Jiri! Yeah I have magic seo for cubecart as you know =) (Tomas / Sweden)

How can I overwrite it and check that do you mean?
The product redirect works perfect but redirect categories nothing happens at all when I do as I stated above =/

Thanks mate!

inveo
Inveo Support
Posts: 1273
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [CubeCart] How do I redirect 301 (dynamic urls)

Postby inveo » Tue Jun 03, 2008 11:59 am

For categories use:

Code: Select all

RewriteCond %{QUERY_STRING} ^cat_id=X$
RewriteRule ^index.php$ index.php?act=viewCat&catId=Y [L,QSA]


X - old category ID
Y - new category ID

growlight
Posts: 3
Joined: Thu Apr 16, 2009 1:07 pm

Re: [CubeCart] How do I redirect 301 (dynamic urls)

Postby growlight » Thu Mar 04, 2010 8:19 pm

~J~ wrote:Please make sure your .htaccess file keep changes and is not overwritten.


Hey J!
How do I do that exactly...its been frustrating me for some time.
-Christopher

inveo
Inveo Support
Posts: 1273
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [CubeCart] How do I redirect 301 (dynamic urls)

Postby inveo » Fri Mar 05, 2010 10:34 am

Look to the code I have posted and only replace X and Y.
Magic SEO URLs for CubeCart


Return to “Custom Rewrite Rules”

Who is online

Users browsing this forum: No registered users and 0 guests