I've been working on this problem for a whole day now, searching pretty much everything that might be helpful, but I just can't find a solution.
I maintain a forum which is in two subdirectories of the website. The site itself runs with WordPress and the forum has always been installed two levels deep. So:
Now the domain has to be changed and the forum has to be on a level above, so:
That's working so far. I changed the script_path in the database and all that works just fine. The problem is the .htaccess redirect. I searched and tested as much as possible but it just won't work.
I tried these rules that were also working just fine on an .htaccess-testsite.
Code: Select all
RewriteEngine On RewriteRule ^folder/forum/index.php?(.*)$ forum/index.php?$1 [R=301,L] RewriteRule ^folder/forum/viewforum.php(.*)$ forum/viewforum.php$1 [R=301,L] RewriteRule ^folder/forum/viewtopic.php(.*)$ forum/viewtopic.php$1 [R=301,L] RewriteRule ^folder/forum/memberlist.php?(.*)$ forum/memberlist.php?$1 [R=301,L]
The following though weirdly works all the time: if I type https://newsite.com/folder/forum I am always redirected to https://newsite.com/forum. No matter what I type instead of "folder", it always redirects me to the correct URL even if nothing is set in both .htaccess files. Why is that the case and how can I get the other redirects to work?
Thanks a lot in advance,