Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I have an old site with link:

https://www.oldsite.com/our-range/

On the new site I'm building the URL has changed to:

https://www.oldsite.com/products/

I've added this to my HTACCESS, above the Couch generated HTACCESS:

ReDirectPermanent /our-range/ https://www.newsite.com/products/

When I navigate to:

https://www.newsite.com/our-range/

I am redirected to this URL which displays my custom error 404:

https://www.newsite.com/products.php/?fname=our-range

I note the following lower down in the HTACCESS

Code: Select all
#products.php
RewriteRule ^products$ "$0/" [R=301,L,QSA]
RewriteRule ^products/$ products.php [L,QSA]
RewriteRule ^products/.*?([^\.\/]*)\.html$ products.php?pname=$1 [L,QSA]
RewriteRule ^products/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ products.php?d=$1$2$3 [L,QSA]
RewriteRule ^products/[^\.]*?([^/\.]*)/$ products.php?fname=$1 [L,QSA]
RewriteRule ^products/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]


What am I doing wrong?

Thank you!
Perhaps the following thread would help? -
viewtopic.php?f=4&t=12344
Tried that. Sadly I get the same result.

I removed the existing redirect, as detailed up thread, and made a new line where you proposed in your linked thread, which said:

RewriteRule ^/our-range https://www.newsite.com/products/ [R=301,L,QSA]

I also tried:

RewriteRule ^/our-range https://www.newsite.com/products [R=301,L,QSA]
RewriteRule ^/our-range/ https://www.newsite.com/products/ [R=301,L,QSA]

I repeatedly refreshed the site, and tried it in a fresh browser.

Same result. It takes me here and displays a 404:

https://www.newsite.com/products.php/?fname=our-range

NB. Unsure if it matters, but in fact the above include sub-folders and the rewritebase is not "/". I removed them for clarity as I don't believe they're important. All else is working OK including other redirects.
3 posts Page 1 of 1