Hi,
I have 1000's of individual pages that are now 301 redirects in my htaccess on an nginx server.
eg Redirect 301 /directoryname/pagename.html https://www dot anewdomain dot com/newpage
All of them work fine. After 1000's of these I want to make sure any other requests to that directory are also redirected and dont end up as 401 page not found.
I have tried the below method but it does not work.
Redirect 301 /directoryname/pagename.html https://www dot anewdomain dot com/newpage
Redirect 301 /directoryname/pagename1.html https://www dot anewdomain dot com/newpage1
RewriteRule ^directoryname/(.*?)$ https://www dot anewdomain dot com [R=301,NE,NC,L]
What happens is all of the Redirect 301's get ignored and the Rewrite rule takes precedence? All requests to any page in /directoryname/ that were previously redirected by Redirect 301 /directoryname/pagename.html https://www dot anewdomain dot com/newpage are ignored. All requests now redirect the same as this rule RewriteRule ^directoryname/(.*?)$ https://www dot anewdomain dot com [R=301,NE,NC,L]
How can I get it so that ONLY requests for pages in that directory without Redirect 301 /directoryname/pagename.html https://www dot anewdomain dot com/newpage are redirected to https://www dot anewdomain dot com?
Thanks in anticipation of your help.