Mirroring Site, but login not working anymore (cross domain)

debcat24
User w
User w
Posts: 5
Joined: Tue Mar 01, 2022 10:03 am

Mirroring Site, but login not working anymore (cross domain)

Post by debcat24 »

Hi,

I have a staging site and its being mirrored in another domain. Therefore for the mirrored site to not look broken I needed to change most of the url links to relative. I've managed to do this however when I try to login it keeps redirecting me back to the staging domain. Is your plugin w3all using relative urls and if not can this be done ?

[TITLE EDITED]

User avatar
axew3
w3all User
w3all User
Posts: 2497
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Mirroring Site, but login not working anymore

Post by axew3 »

I assume you can't link this way, because it look in effect like, a cross domain integration.
But you could set the integration as not linked users mode into the staging, if into another domain that is not a sub.domain where the linked phpBB effectively reside
p.s let see how to fix or optimize this aspect, if it is still not, on coming 2.5.9 ...
Let know!

[EDITED]

debcat24
User w
User w
Posts: 5
Joined: Tue Mar 01, 2022 10:03 am

Re: Mirroring Site, but login not working anymore

Post by debcat24 »

Let me give you an example so that you can know with what I'm working with..
The Staging site is a subdomain of the live site so for example : staging.livedomain.com
The mirrored site is another domain completely and its using www.domain.com/livedomain

I've checked the plugin files and there is a script wp_w3all.php and tried changing the redirect link from there however it still got redirected to my staging site.

User avatar
axew3
w3all User
w3all User
Posts: 2497
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Mirroring Site, but login not working anymore

Post by axew3 »

The integration code is intended for integrations on domain or sub.domains and not cross domain.
You are linking the staging site, that reside into domain livedomain.com, to a phpBB that is into another domain domain.com.
The unique solution for this is to setup the integration as not linked users (activate option into plugin admin).
Not sure if will work, this aspect i will check and clear before 2.5.9 release, fixing this aspect if still it is not completely (not considered/tested by long time).
But this will not anyway fix the fact, that the integration with linked users, will work only on same domains.
Your case is

staging.livedomain.com
that is not subdomain of
.domain.com/livedomain

so to test with linked users, you have to install also phpBB somewhere in livedomain.com
or subdomains like for example staging.livedomain or asite.livedomain

substantially, the same domain or sub.domain where wp reside

[EDITED]

debcat24
User w
User w
Posts: 5
Joined: Tue Mar 01, 2022 10:03 am

Re: Mirroring Site, but login not working anymore

Post by debcat24 »

axew3 wrote:
Tue Mar 01, 2022 10:46 am
The integration code is intended for integrations on domain or sub.domains and not cross domain.
You are linking the staging site, that reside into domain livedomain.com, to a phpBB that is into another domain domain.com.
The unique solution for this is to setup the integration as not linked users (activate option into plugin admin).
Not sure if will work, this aspect i will check and clear before 2.5.9 release, fixing this aspect if still it is not completely (not considered/tested by long time).
But this will not anyway fix the fact, that the integration with linked users, will work only on same domains.
Your case is

staging.livedomain.com
that is not subdomain of
.domain.com/livedomain

so to test with linked users, you have to install also phpBB somewhere in livedomain.com
or subdomains like for example staging.livedomain or asite.livedomain

substantially, the same domain or sub.domain where wp reside

[EDITED]
I'm not understanding you completely.. I am only using one database that is located on the staging site. Therefore im not linking the users I'm using the same database. The phpbb is only saved on the staging site as I cannot install this on the mirrored site. In your plugin scripts which variable is being used to save the domain name and being used as a redirect after user clicks on the submit button of the login please :) ?

User avatar
axew3
w3all User
w3all User
Posts: 2497
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Mirroring Site, but login not working anymore

Post by axew3 »

/wp-content/plugins/wp-w3all-phpbb-integration/wp_w3all.php
on top of the file, there are ALL the vars used.
There is momentary mix due to the switch for the new way to get/store phpBB db connection values since last versions and the old plugin way that was using the phpBB config file inclusion.

But these values are not used to redirect anywhere, default wp values are used, and the phpBB URL setting you setup into plugin admin (that is used to point widgets and shortcodes links that points to phpBB)

about the domain:
it is extracted from phpBB config:
private static function w3all_get_phpbb_config(){
into
/wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php

p.s since you use this for free
In your plugin scripts
it is also your

debcat24
User w
User w
Posts: 5
Joined: Tue Mar 01, 2022 10:03 am

Re: Mirroring Site, but login not working anymore (cross domain)

Post by debcat24 »

Since you're using the phpbb config details and some of the WP would it be possible to change the WP domain url to be relative ?

Since the phpbb login is also using cookie information to login, so having two different domains like i showed you previously, would still have the issue of redirection to the staging site.. even if the url of wp was changed to relative correct?

User avatar
axew3
w3all User
w3all User
Posts: 2497
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Mirroring Site, but login not working anymore (cross domain)

Post by axew3 »

Ok got it, let see ... but i start to think that your problem is something else

...ps i hope you mean as not linked users mode, because if not i still have not well understand maybe what you try to do :cry:

User avatar
axew3
w3all User
w3all User
Posts: 2497
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Mirroring Site, but login not working anymore (cross domain)

Post by axew3 »

So here we go with an example, or i think i go to mess up not understanding.
I have a test site old domain my infamous w3it.org.
So i installed there Woocommerce, WP, and phpBB.

Now i linked the w3it.org plugin db connection to the axew3.com database, and i have setup the integration as NOT LINKED USERS.
The result i have is that of course WP at w3it.org run as independent and just use db connections values to retrieve forum's posts that display on widgets or shortcodes and are pointing to axew3.com.

But there is no issue with any user into this site, that is completely different from axew3.com.
I created at w3it.org an user
crossdomain and pass crossdomain
as test that you can try to login with credentials both into WP default or woocommerce login to test that all is working fine:
https://www.w3it.org/main/my-account/
or
https://www.w3it.org/main/wp-admin

could you point me to what instead are you doing that return you the wrong result, that i have not understand?
It is something else that leads you to the login redirect problem you have?

debcat24
User w
User w
Posts: 5
Joined: Tue Mar 01, 2022 10:03 am

Re: Mirroring Site, but login not working anymore (cross domain)

Post by debcat24 »

Thanks for your example, would it be possible to chat privately ?

Post Reply