Redirection Puzzle - it's got me puzzled anyhow!
But then I'm a bear of very little brain!
The finished website has just been converted from an old aspx affair to a wordpress site. Some directory structures have changed significantly; there appears to be a load of older medical articles that have not been added back in and it sounds unlikely that they will be.
The htaccess file starts with ithemes security's code, Followed by the main wordpress block and I have added the user redirects to the final section of the htaccess file . I have been through the redirects and rewrites line by line to verify them and the following sections are giving me problems. This is probably my aging brain simply failing to grasp basic logic.
If I can tap into anybody's wisdom for a bit of help I would appreciate it. My eyes and brain are gone to jelly. I have used htaccesscheck.com
to check out the underlying syntax and ironed out the basic errors that I had previously missed. The bulk of the redirects are working correctly._________________________________________________________________________
# In the first section of redirects, 2 adjacent lines: one works and one doesn't! I've checked the destination URLs are accurate and the original URL paths are as crawled on the old site. I can discern no reason for the different result.
Line 299 redirect 301 /Contactus.aspx http://www.SITENAME.ac.uk/about/contact-us/
Line 300 redirect 301 /Feedback.aspx http://www.SITENAME.ac.uk/about/contact-us/
there are some very long media URLs which are absent on the new site and I am simply redirecting visiting spiders to the page that will hold media in future. Media items refuse to redirect
Line 408 redirect 301 /Professionals/Biomedicalforum/Recordedfora/Rich%20Media%20http:/kplayer.kcl.ac.uk/ess/echo/presentation/15885525-ff02-4ab2-b0b9-9ba9d97ca266 http://www.SITENAME.ac.uk/biomedical-forum/recorded-fora/
Line 409 redirect 301 /Professionals/Biomedicalforum/Recordedfora/Quicktime%20http:/kplayer.kcl.ac.uk/ess/echo/presentation/15885525-ff02-4ab2-b0b9-9ba9d97ca266/media.m4v http://www.SITENAME.ac.uk/biomedical-forum/recorded-fora/
Line 410 redirect 301 /Professionals/Biomedicalforum/Recordedfora/Mp3%20http:/kplayer.kcl.ac.uk/ess/echo/presentation/15885525-ff02-4ab2-b0b9-9ba9d97ca266/media.mp3 http://www.SITENAME.ac.uk/biomedical-forum/recorded-fora/_________________________________________________________________________#Old
site pagination URLs redirected to new news top level page - Here I am simply pointing all the pagination URLs for the news section, that were indexed, to the main news page. These work but append the pagination code on to the new visible URL. Have I got the syntax correct in this version of the lines to suppress the appended garbage?
RewriteRule ^/LatestNews.aspx(?:.*) http://www.SITENAME.ac.uk/news-events/latest-news/
# In this section - I am redirecting old article urls to the identical material in the new website which is in a completely different folder structure, but has retained the same file name without the .aspx extension. I have double checked each originating path and each destination URL and they check out but deliver a 404 page instead of redirecting successfully. (APART From 1 URL where I have highlighted it with the ~~~ in the order it appears in the succession)
redirect 301 /Blab/Blabbitall/1935/new-immunotherapy-trial-launched.aspx http://www.SITENAME.ac.uk/1935/03/20/new-immunotherapy-trial-launched-to-test-cancer-vaccine/
~~~redirect 301 /Blab/Blabbitall/1935/bun-fight-South-cabbage-doctoral-support-funding.aspx http://www.SITENAME.ac.uk/1935/01/14/bun-fight-south-cabbage-doctoral-support-funding/
redirect 301 /Blab/Blabbitall/1934/benjamin-Franklin-honoured-in-launch-of-state-of-the-art-computing-facility.aspx http://www.SITENAME.ac.uk/1935/01/14/benjamin-franklin-honoured-in-launch-of-state-of-the-art-computing-facility-2/
redirect 301 /Blab/Blabbitall/1934/Scientists-genetically-engineer-patients-own-cells-to-attack-cancer.aspx http://www.SITENAME.ac.uk/1934/12/14/scientists-genetically-engineer-patients-own-cells-to-attack-cancer/
redirect 301 /Blab/Blabbitall/1935/Simple-test-could-improve-treatment-for-biggest-leukaemia-killer.aspx http://www.SITENAME.ac.uk/1935/01/14/simple-test-could-improve-treatment-for-biggest-leukaemia-killer/
redirect 301 /Blab/Blabbitall/1935/clinical-training-fellowship-open-for-applications.aspx http://www.SITENAME.ac.uk/1935/01/14/clinical-training-fellowship-open-for-applications/
redirect 301 /Blab/Blabbitall/knights-Health-Partners-awarded-Comprehensive-Cancer-Centre-status.aspx http://www.SITENAME.ac.uk/1935/01/02/knights-health-partners-awarded-comprehensive-cancer-centre-status/
redirect 301 /Blab/Blabbitall/1934/New-BRC-funding-competition-launched.aspx http://www.SITENAME.ac.uk/1935/02/14/new-brc-funding-competition-launched/
redirect 301 /Blab/Blabbitall/1934/Cell-and-gene-therapy-project-gets-underway.aspx http://www.SITENAME.ac.uk/1935/01/14/cell-and-gene-therapy-project-gets-underway/
redirect 301 /Blab/Blabbitall/1934/Obesity-research-funding-call.aspx http://www.SITENAME.ac.uk/1934/12/14/obesity-research-funding-call/
redirect 301 /Blab/Blabbitall/1934/German-partner-boosts-pioneering-work.aspx http://www.SITENAME.ac.uk/1935/03/16/german-partner-boosts-pioneering-work/
redirect 301 /Blab/Blabbitall/1934/New-chief-operating-officer-in-post.aspx http://www.SITENAME.ac.uk/1935/03/14/new-chief-operating-officer-takes-up-post/
redirect 301 /Blab/Blabbitall/1934/Government-announces-RD-budget-is-protected.aspx http://www.SITENAME.ac.uk/1935/02/02/government-announces-rd-budget-is-protected/
redirect 301 /Blab/Blabbitall/1934/MSc-in-Genomics-launched-at-knights-College-cabbage-with-help-from-BRC.aspx http://www.SITENAME.ac.uk/1934/11/14/msc-in-genomics-launched-at-knights-college-cabbage-with-help-from-brc/
redirect 301 /Blab/Blabbitall/1934/Scientists-unravel-more-of-the-genetic-puzzle-surrounding-lupus.aspx http://www.SITENAME.ac.uk/1934/10/14/scientists-unravel-more-of-the-genetic-puzzle-surrounding-lupus/
redirect 301 /Blab/Blabbitall/1934/New-trials-to-revolutionise-diabetes-treatment.aspx http://www.SITENAME.ac.uk/1934/09/22/new-trials-to-revolutionise-diabetes-treatment/
redirect 301 /Blab/Blabbitall/1934/Blood-pressure-device-is-a-top-lifesaver.aspx http://www.SITENAME.ac.uk/1934/08/22/blood-pressure-device-is-a-top-lifesaver/
redirect 301 /Blab/Blabbitall/1934/Brain-activity-sheds-light-on-ADHD-persistence-and-recovery.aspx http://www.SITENAME.ac.uk/1934/08/10/brain-activity-sheds-light-on-adhd-persistence/
redirect 301 /Blab/Blabbitall/1934/gestational-diabetes-in-obese-women.aspx http://www.SITENAME.ac.uk/1934/07/09/gestational-diabetes-in-obese-women/
redirect 301 /Blab/Blabbitall/1934/Stem-cell-therapy-for-inherited-skin-blistering.aspx http://www.SITENAME.ac.uk/1934/05/26/stem-cell-therapy-for-inherited-skin-blistering/
redirect 301 /Blab/Blabbitall/1934/Pioneering-drug-tested-that-aims-to-prevent-arthritis.aspx http://www.SITENAME.ac.uk/1934/04/17/pioneering-drug-tested-that-aims-to-prevent-arthritis/
redirect 301 /Blab/Blabbitall/1935/new-BRC-newsletter-launched-.aspx http://www.SITENAME.ac.uk/news-events/latest-news/_________________________________________________________________________#Old
site 1934 unmatched articles redirected to new news top level page: In this section I became coonfused about whether to use Redirect Match or RewriteRule to point the articles in each year directory back to the top level news page. Currently I'm getting a 404 for any of the old URLs in these year by year directories instead of a successful redirect. I suspect Regex lingo is not for old farts like me ;-) My logic here was rewrite any aspx file in the directory to the latest news page at the top. Initially it was thought that there would be a need to redirect a group of articles to an archive on the new website. However the client is being indecisive on this issue and I need to correct the 404s created by these commands. This is my latest attempt to rectify the fault. Am I nearer with my syntax.
RewriteRule ^/Blab/Blabbitall/1934/(.*)/.aspx http://www.SITENAME.ac.uk/news-events/latest-news/
site 1933 unmatched articles redirected to new news top level page
RewriteRule ^/Blab/Blabbitall/1933/(.*)/.aspx http://www.SITENAME.ac.uk/news-events/latest-news/
site 1932 unmatched articles redirected to new news top level page
RewriteRule ^/Blab/Blabbitall/1932/(.*)/.aspx http://www.SITENAME.ac.uk/news-events/latest-news/
site 1931 unmatched articles redirected to new news top level page
RewriteRule ^/Blab/Blabbitall/1931/(.*)/.aspx http://www.SITENAME.ac.uk/news-events/latest-news/
site 1930 unmatched articles redirected to new news top level page
RewriteRule ^/Blab/Blabbitall/1930/(.*)/.aspx http://www.SITENAME.ac.uk/news-events/latest-news/
redirect 301 /News/Events/EventsCalendar.aspx http://www.SITENAME.ac.uk/news-events/events/
RewriteRule ^/Blab/Blabbitall/1930/ http://www.SITENAME.ac.uk/news-events/events/
these to main education URL
redirect 301 /Resources/branding/BRCacknowledgementuseofBRCresources04071931.pdf http://www.SITENAME.ac.uk/education-training/
redirect 301 /Resources/Professionals/Supportservices/james-lind-glossary-of-research-terms.pdf http://www.SITENAME.ac.uk/education-training/