将Wordpress安装移动到其文件夹后重定向问题

amazing people!

I have installed a Wordpress on my localhost (MAMP on mac) I tried to be "fancy" and give the WordPress its own folder. I used the Method 1 (without URL change) to give my WordPress installation its directory. I followed every step carefully instructed on WordPress

I moved the files and database to the web server after I was done with changes. The browser could not load my website anymore because of too much redirect error. There is no problem with the website on localhost at all. I get redirect issues only after moving the files to the server. Its very strange and I can not understand what I am missing out here. I would appreciate if you save me from pulling my hairs out! :-D

These are the rules I added to .htaccess in my root directory

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteCond %{REQUEST_URI} !^/my_subdir/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /my_subdir/$1
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ my_subdir/index.php [L] 
</IfModule>

All the Wordpress files are in the my_subdir folder with a .htaccess containing following rules:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Siturl & home are having HTTPS enabled by adding (s) in the end of http. This is how they are in the tables:

siteurl     https://example.com
home        https://example.com

If your WordPress installation is in the my_subdir, then shouldn't your .htaccess be:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /my_subdir/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /my_subdir/index.php [L]
</IfModule>
# END WordPress