Managing 301 Redirects correctly in FlyNax htaccess file
Hello:
I have just converted a long standing live classifieds site to FlyNax version 4.6.1
I am now trying to manage the hundreds, and even thousands of broken links.
I would normally do this with .htaccess with a Redirect Permanent statement.
For example:
at the very bottom of the .htaccess in the root of flyNax installation.
I have
RedirectPermanent /Home/ClassifiedsAds/163/ https://www.concreteiron.com/classifieds.html
But this statement does not seem to have any affect, and it just goes to a FlyNax generated 404 page.
OR it will take me a "site cannot be reached" page, which seems to be breaking the whole site.
How can I manage these redirects correctly?
What am I doing wrong?
Is there some different way to do this?
I have hundreds of them.
I dont want Google to report them as broken or soft-broken...
What is the best practice for managing 301 redirects in FlyNax?
I have seen other shopping cart and e-commerce programs such as Magento that actually put these in the CMS and allow you to define redirects in the database, and this is very nice.
and it is critical that I save all my existing traffic on the site, to keep my search results high and the traffic coming.
What is the advice?
Redirect still not working as expected
when I try your code it fails.
I put this line at the end of .htaccess in the root folder
Redirect /Home/ClassifiedsAds/163/ http://www.concreteiron.com/classifieds.html
and the result is "404" not the redirected page
the URL shows parameters being auto added to the address
https://www.concreteiron.com/classif...sifiedsAds/163
how do I get it to not add these url params and do the redirect exact as needed?
Working Code Added, based on FlyNax Support answer
okay after discussions with FlyNax Support and clearing my cache on my browser correctly, I have determined that the last suggestion does actually work.
However, the position is critical. I was trying to put it at the end of .htaccess, but it actually needs to live just above the last few Rewrite rules
Here is the code I added to .htaccess but is HAS TO BE before the "define other pages" Rewrite block approximately around line 190 in v4.6.1 .htaccess file
#code has to be before the "define other pages" rewrite rule block and sitemaps block to work correctly
# /Home/ClassifiedAds/ pattern matching 301 redirects ( jeff 2018-01-06 )
#test https://www.concreteiron.com/Home/ClassifiedsAds/163/
#test https://www.concreteiron.com/Home/Cl...ng&Model=P-305
#test https://www.concreteiron.com/(X(1)S(...ookieSupport=1
#result https://www.megairon.com/classifieds.html
RewriteRule ^(.*)Home/ClassifiedsAds/(.*)$ /classifieds.html? [R=301,L] #all old links in the HOME ClassifiedsAds Structure
# ^ symbol starts a string to match
# $ symbol ends a string to match
# (.*) wildcard for any string and/or query string
# ? symbol at end of classifieds.html tells it to not add any query string params, (greedy operator, eats all)