Archived topic
Cannot 301 redirect in "product" page affiliate url?
22 replies · Started by robchanoi on September 27, 2018
hi,
Just wondering why u cannot 301 redirect in "product" page affiliate url in WC?
All links must be external?
Tks.
Hi there,
so can you explain a little more? Do you want that product to redirect to the affiliate link?
If so the best way is to set the product up as an External Product.
External product is listed as external/affiliate product under product data beneath the wp editor. It doesn't allow you to set up a redirecting internal link to an external affiliate link, any ideas?
Thanks.
Clicking the button if saved as an internal redirect will not take you to the affiliate link, takes you no where in fact. Only external link works as stated in Wp editor.
Looks like it could be useful, thanks. Please allow a while to wrap my brain round.
OK - if you figure it out let me know :)
I have tried placing rel=”nofollow” in /woocommerce/includes/wc-template-functions.php like this: function woocommerce_template_loop_product_link_open() { echo '<a href="' . get_the_permalink() . '" rel="nofollow">'; }
No joy.
Currently still having to use affiliate urls in here:

I'm not sure I understand. You want to redirect to an external link when someone visits one of your products?
Couldn't you just set up the 301 redirect inside your .htaccess file? Or use a redirection plugin?
No. They are Not my products, these are affiliate products, I don't own them, I just refer people to them.
I'm using a 301 plugin which works/worked fine except with with this gp/wc product page.
It doesn't redirect to the affiliate site, or open in a new tab. The page just refreshes.
Any chance you can link me to the page where I would click the button to be taken to the affiliate site?
Hi, apologies for delay - I've swapped over the aff url for now back to a 301 redirect on this page:
the 301 url is http://menspleasures.com/kiiroo-onyx which redirects but not when placed in the Product Url box.
So the http://menspleasures.com/kiiroo-onyx redirect to the affiliate works fine when added to the browser.
For some reason, the actual Visit Product button is just refreshing the page.
Have you asked WooCommerce about this?
Yes, that's exactly what I've been attempting to explain :)
Not yet no as I believe I didn't have an issue with previous theme.
The theme itself shouldn't have any control over redirects.
What happens if you temporarily switch to one of the Twenty-x themes? The issue goes away?