Simple Membership Plugin › Forums › Simple Membership Plugin › Subdomain access and main domain access compatibility
- This topic has 4 replies, 2 voices, and was last updated 11 months, 3 weeks ago by
Doblo7.
-
AuthorPosts
-
August 23, 2025 at 9:49 am #31335
Doblo7
ParticipantGood morning,
Sorry to bother you.
First of all, I would like to congratulate you and tell you how much I like your plugin, its ease of use, and its ingenious design. Well done!
I have a question for you: I would like the simple membership plugin installed on my main domain via WordPress to also manage access to my subdomain. I would like only users logged into the main domain with the appropriate access rights to be able to access and log on the subdomain with the same credentials.
Would the following process work?
1. By installing WordPress on the subdomain, I ensure that the subdomain uses the same database as the main domain.
However, I need to use a different table prefix to avoid conflicts. For example, if the main domain uses wp_, I could use wp_sub_ for the subdomain.
2. I install the Simple Membership plugin on my subdomain too. To keep users logged in between the main domain and the subdomain, I would need to configure session cookies. Can I add the following lines to the wp-config.php file of my main domain and subdomain? Or is this not necessary?
define(‘COOKIE_DOMAIN’, ‘.mywebsite.com’);
define(‘COOKIEPATH’, ‘/’);3. I need to ensure that the plugin is configured to use the same membership settings on both installations. This includes membership levels, login pages, and redirects.
If necessary, I could set up redirects so that users are redirected to the appropriate login or registration page, depending on whether they access the main domain or the subdomain.
What do you think? Is there a chance this could work? Am I missing anything ? Do you see any security flaws? Or what other method would you suggest ?
I thank you in advance and wish you a great day.
Kind regards
August 24, 2025 at 12:02 am #31337The Assurer
ModeratorSWPM does not support WordPress Multisite installations. Each sub-site must have its own instance of SWPM.
August 24, 2025 at 5:30 am #31338Doblo7
ParticipantGood morning Sir,
Thank you for your answer.
In my case, and as I specify in point 2, the plugin will also be installed on the subdomain. I apologize, just to be really sure: does this mean that even if the SWPM plugin is installed on both instances, and they share the same database and I coordinate session cookies, it will not serve the purposes I am pursuing ?
Thanks again for your time and your answer.
Kind regards,August 25, 2025 at 12:11 am #31339The Assurer
ModeratorBoth the main domain and the subdomain must either have their own instances of WordPress or running WordPress Multisite. Both the main domain and the subdomain must have their own installs of SWPM. The subdomain copy of SWPM will have its own tables.
August 25, 2025 at 5:09 am #31340Doblo7
ParticipantGood morning Sir,
I understand.
Thanks you for your help.Kind regards,
-
AuthorPosts
- You must be logged in to reply to this topic.