I had this same problem. There was an easy fix for me. Hopefully this will help someone else.
Here was my set up…I have my wordpress running in a subdirectory called ‘blog.’ The htaccess that was in my root folder for my main site was causing the redirect. It was because of the DirectoryIndex line. Basically the DirectoryIndex line does this: when you type example.com/blog, you are telling the browser to open a directory (aka a folder) called ‘blog’ on your server. Since no specific file or page was specified in the URL, the browser looks for an index page (index.php .html, whatever) to display, or it looks at the htaccess file to tell it where to go. So because my htaccess file in my root folder said ‘DirectoryIndex /blah/blah’ instead of ‘DirectoryIndex index.php’, the browser redirected to https://www.example.com/blah/blah.
The solution is to make an htaccess file specifically for the subdirectory (folder) ‘blog.’ All you need to do is open a basic text editor and type DirectoryIndex index.php
. Save it as .htaccess and upload it to the subdirectory ‘blog.’
This will stop the undesired redirecting. Hopeflly I explained everything clearly so if anyone else with this problem stumbles upon this thread thru google like I did, they can fix this.