Why is index.php being redirected?
-
Hi all. Silly question time I think. Be gentle!
I have had a phpBB site running for about 15 years and now want to wrap it in a WP site. The WP w3all phpBB plugin looks ideal. I don’t want to migrate the phpBB install, because a) I quite like phpBB as a forum and b) after 15 years, it’s got some pretty good search engine placement.
The phpBB site was and is installed in a /forum sub-directory. I want to leave it there (as already mentioned) for search engine reasons. I think it also makes sense to keep it separate.
I have always had an apache redirect in place, such that anyone going to the main domain, always gets moved to the /forum directory and all is well in the world. I did this, as even way back then, I had an inkling that I would expand it to a fuller site.
I have now installed WP in the root. So I now have WP in /public_html and phpBB in /public_html/forum. All good so far.
Whilst I develop the WP site (which may take me some time), I want people to continue to just get moved to the /forum directory and just see the phpBB forum – and have no idea that the WP site even exists.
The following seems to work fine:-
# php -- END cPanel-generated handler, do not edit RewriteCond %{HTTP_HOST} ^thepompeychimes\.net$ [OR] RewriteCond %{HTTP_HOST} ^www\.thepompeychimes\.net$ RewriteRule ^/?$ "https\:\/\/thepompeychimes\.net\/forum" [R=301,L]
That should only redirect the URIs: thepompeychimes.net/ and https://www.thepompeychimes.net/ (with or without the trailing ‘/’.
If I enter https://thepompeychimes.net/index_pre_wordpress.php, it correctly does NOT redirect. However, the WP https://thepompeychimes.net/index.php file DOES redirect. I don’t think it is the RewriteRule, otherwise, both URLs would redirect. Is WP somehow causing this? In WP General settings, I can see both WordPress Address and Site Address are set to https://thepompeychimes.net. Is WP causing this, such that when I enter https://thepompeychimes.net/index.php, it does actually execute index.php, but a set of steps subsequently redirect https://thepompeychimes.net/index.php to https://thepompeychimes.net due to the Site Address setting, which then gets redirected by the .htaccess RewriteRule?
Any help is appreciated. I can get to other pages, such as the login page and I can display the sample page installed with WP. But the home page (index.php) always gets redirected to the phpBB forum.
- The topic ‘Why is index.php being redirected?’ is closed to new replies.