Page 1 of 1

.htaccess rewrite rule not working ?

Posted: Thu Jan 30, 2020 3:25 am
by Baptiste
I'm trying to prevent phpBB users from registering or login from phpBB.
Instead I want them to use /login and /register pages on my WP.

I tried creating .htaccess RewriteRule in phpBB .htaccess and in WP .htaccess, nothing worked.
I tried everything with Rewrite base as well, nothing seems to work.

My phpBB is inside my wordpress directory, like :
https://www.mydomain.com/wordpress/phpBB

I suspect WP is over-riding any rewrite rule I try, do you maybe have an idea of how I should do ?

Re: .htaccess rewrite rule not working ?

Posted: Thu Jan 30, 2020 7:11 am
by muti
Your link do now work. And cannot see the login url, the url is not static to make it easy.
Page not found
The page you requested could not be found.

Re: .htaccess rewrite rule not working ?

Posted: Thu Jan 30, 2020 8:17 am
by axew3
I'm trying to prevent phpBB users from registering or login from phpBB.
Instead I want them to use /login and /register pages on my WP.
This can be achieved in several ways.
So you disabled registrations in phpBB, then you want that if an user try to access the registration page in phpBB, it is redirected to wp registration page, in the case he will try to access via direct phpBB url.
And you do not want users login in phpBB.

Disable registration in phpBB.
Then deactivate the fast login (maybe) that appear into index bottom, disabling into acp.
Then you could do via js, detecting onclick the event.
Yes via htaccess more secure ...

This is the easy way using htaccess:

Open .htaccess in phpBB, and where

Code: Select all

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]
immediately BEFORE add this:

Code: Select all

RewriteCond %{QUERY_STRING} ^(.*)(mode=login&)(.*)?$
RewriteRule . https://subdomain.w3host.com/wordpress/wp-login.php [R,L]
Change https://subdomain.w3host.com/wordpress/wp-login.php to point to where you need to be redirected

Re: .htaccess rewrite rule not working ?

Posted: Thu Feb 06, 2020 1:08 am
by Baptiste
Thanks, that worked perfectly !