.htaccess rewrite rule not working ?

Baptiste
User w
User w
Posts: 6
Joined: Sun Jan 26, 2020 1:35 am

.htaccess rewrite rule not working ?

Post 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 ?
muti
User w
User w
Posts: 16
Joined: Thu Dec 26, 2019 5:45 am

Re: .htaccess rewrite rule not working ?

Post 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.
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: .htaccess rewrite rule not working ?

Post 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
Baptiste
User w
User w
Posts: 6
Joined: Sun Jan 26, 2020 1:35 am

Re: .htaccess rewrite rule not working ?

Post by Baptiste »

Thanks, that worked perfectly !
Post Reply