Jump to content

Archived

This topic is now archived and is closed to further replies.

NodsDorf

drawing a blank on a 301 redirect

Recommended Posts

Trying to just redirect an old product to a new product.

 

Old url

/catalog/neoprene-multi-convoluted-rubber-bellow-290mm-40mm-connector-48mm-p-8213.html

 

New url

/catalog/neoprene-multi-convoluted-rubber-bellow-290mm-40mm-connector-48mm-p-9280.html

 

My .htaccess method...

Redirect 301 /catalog/neoprene-multi-convoluted-rubber-bellow-290mm-40mm-connector-48mm-p-8213.html   http://www.OURSITE.com/catalog/neoprene-multi-convoluted-rubber-bellow-290mm-40mm-connector-48mm-p-9280.html

 

My Result

What I'm getting is the new url with the Product ID appended..

catalog/neoprene-multi-convoluted-rubber-bellow-290mm-40mm-connector-48mm-p-9280.html?products_id=8213

 

We are running Ultimate SEO V2.2d which also has the following in .htaccess

and I am assuming it is causing the conflict because I'm doing it wrong...

 

# Begin Ultimate SEO V2.2d
Options +FollowSymLinks
RewriteEngine On

 # RewriteBase instructions
 # Change RewriteBase dependent on how your shop is accessed as below.
 # http://www.mysite.com = RewriteBase /
 # http://www.mysite.com/catalog/ = RewriteBase /catalog/  
 # http://www.mysite.com/catalog/shop/ = RewriteBase /catalog/shop/

 # Change the following line using the instructions above  

RewriteBase /catalog/

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-by-(.*).html$ all-products.php?fl=$2&%{QUERY_STRING}
RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-au-(.*).html$ articles.php?authors_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-f-(.*).html$ faqdesk_info.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fc-(.*).html$ faqdesk_index.php?faqPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fri-(.*).html$ faqdesk_reviews_info.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fra-(.*).html$ faqdesk_reviews_article.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-links-(.*).html$ links.php?lPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pm-([0-9]+).html$ info_pages.php?pages_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-n-(.*).html$ newsdesk_info.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nc-(.*).html$ newsdesk_index.php?newsPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nri-(.*).html$ newsdesk_reviews_info.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nra-(.*).html$ newsdesk_reviews_article.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-po-([0-9]+).html$ pollbooth.php?pollid=$2&%{QUERY_STRING}
# End Ultimate SEO V2.2d

 

 

Anybody able to help me with the correct way to do an old product ID to a new one?

Thank you.

Share this post


Link to post
Share on other sites

Try it without the rewritten urls. Just use the standard url format and let the rewriter handle the rest.

Share this post


Link to post
Share on other sites

Tried:

Redirect 301 /catalog/product_info.php?cPath=21_22_27&products_id=8213   http://www.ASTOREHERE.com/catalog/product_info.php?cPath=21_22_27&products_id=9280

and

Redirect 301 /catalog/product_info.php?products_id=8213   http://www.STOREHERE.com/catalog/product_info.php?products_id=9280

 

Still getting the cling-on:

catalog/neoprene-multi-convoluted-rubber-bellow-290mm-40mm-connector-48mm-p-9280.html?products_id=8213

Share this post


Link to post
Share on other sites

Yes, that is what I meant but I misread your post. I thought you were saying it wouldn't redirect. There's nothing in the code to cause the products id to be attached like that. You can force it to do that by adding it to url so maybe it was added somewhere? Here are a few things to try:

 

- Turn off Ultimate SEO and see if the redirect works. If not, then the problem isn't related to that contribution.

 

- If the above works, then use the uninstall option in admin for Ultimate SEO, then refresh the home page on the shop to force a reset of all of the options. If it works, then something was hung-up. If not, then it must be something else in your code that is appending the products ID.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Are you placing the Redirect before the RewriteRules? All I can figure is that you're doing the RewriteRules first, and they're separating out the products_id field into a Query String, which is automatically appended to the URL unless you give some flag that I don't recall at the moment.

 

Also, if you are redirecting to another domain, you might need to add a RewriteCond to select only this (old) site, before engaging in the list of RewriteRules. Hopefully that should exclude your rewritten URL (new domain) from being processed, if that's still happening.

Share this post


Link to post
Share on other sites

Thank you Jack, Nick and Phil.

 

Nick's suggestion worked, take the re-written URL and direct it to a proper URL.

 

Phil

I had been trying both before and after the URL re-writter and was getting the same results. Nicks suggestion works in either case.

To answer the other question...

The product is on the same domain it was just a case of a duplicate product via the manufacture so I had to remove one that had been live for over a year and needed to make sure all bookmarks and SE's were aware of its location.

Share this post


Link to post
Share on other sites

×