404 error on registration
-
Hi,
Thank you first for this great plugin making me easily setup a restricted registration page.
But I have a problem when using it. After I enabled subsite registration on a subsite, I tried to register on it. But the registration page,
/subsite/wp-login.php?action=register
takes me to a new page in following uri,
/subsite/local-signup/
and this page gives a 404 Not Found return as this,
The requested URL /index.php was not found on this server.
Could you please help me out on this problem?
Regards
Haoxian
-
Hi Haoxian,
Can you confirm the WordPress Version you have installed.
..Justin
Yes, of course. I’m using WordPress 4.7.3.
I’m not sure what’s fully going on for you but I have found some necessary updates so have a go with the version 1.3 and let me know.
Hi, I just saw the update and updated it. But the problem is still the same.
Could this be caused by some URL rewriting rules? Just a guess, or else I could’ve tested it by now. I’m using pretty permalink with no index.php appended in all the URLs on my site. Could you suggest some testings for me to try?
you can install the query-monitor plugin it also can set an authentication cookie which allows you to view Query Monitor output when you’re not logged in.
so set the cookie (found at the bottom of the page expanded) … logout and goto ‘https://yoursite/local-signup’
it should be showing that the template is found ‘wp-content/plugins/network-subsite-user-registration/template/page-signup-wp47.php’
you could send the query monitor results to me at https://justinandco.com/plugins/contact/
-
This reply was modified 7 years, 11 months ago by
Justin Fletcher.
-
This reply was modified 7 years, 11 months ago by
Justin Fletcher.
Thank you, Justin,
I tried the query-monitor plugin and set an authentication cookie so that I can view Query Monitor output. But the problem is that when I click
register
link, the page is redirected to/local-signup/
and this page looks like this:Not Found The requested URL /index.php was not found on this server.
So there is nothing I can see from this error page. And situation is the same when I go to
/local-signup/
directly after logout.Then I went to check server log. Here is something I got from the access log of Apache when I click
register
link to be redirected to/local-signup/
,[21/Mar/2017:04:26:52 +0800] "GET /subsite/wp-login.php?action=register HTTP/1.1" 302 - " [21/Mar/2017:04:26:53 +0800] "GET /subsite/local-signup/ HTTP/1.1" 404 207"
**Some information has been removed.
In the meantime, nothing occurs in error log.
Is there anything else I can do?
BTW, I’ve checked that the file
wp-content/plugins/network-subsite-user-registration/template/page-signup-wp47.php
is there on the server with correct access permission.When you click the ‘register’ link you will be redirected to the
https://mainsite.com/subsite/local-signup
this is what the plugin does.few new things to try..
1) re-save your permalinks so …Settings >> Permalinks >> select “Post name” >> re-save.
see if that helps.2) run through the help for debugging by scribu https://github.com/scribu/wp-posts-to-posts/wiki/Troubleshooting follow the flow diagram (de-activating plugins and switch themes) if you get to a point where the register link works then you have found the conflict.
let me know how you get on.
Hi there,
I have tried these two suggestions with no luck.
Could I just load the link
https://mainsite.com/subsite/local-signup
for testing? I did so.1) Re-set permalinks to any other format does not work.
2) I am using the official theme (2017). After deactivating all plugins except this one, the link still brings me the same error page.So, if this is not a bug in the plugin, then it must be something wrong with my server configuration. But I do not know how to check for this error.
I think maybe I should just live with that and let user register on the network but not the specific subsite.
Thank you very much for your kind help.
Hi there,
I just realised that I am using PHP-FPM for the server. For the multisite, I use something like the follows as the rules for ProxyPassMatch,
<IfModule mpm_event_module> ProxyPassMatch ^/([_0-9a-zA-Z-]+/)?(wp-(activate|blog-header|comments-post|config|cron|links-opml|load|login|mail|settings|signup|trackback)\.php(/.*)?)$ fcgi://127.0.0.1:9000/srv/www/domain.com/public_html/$2 ProxyPassMatch ^/([_0-9a-zA-Z-]+/)?(xmlrpc\.php(/.*)?)$ fcgi://127.0.0.1:9000/srv/www/domain.com/public_html/$2 ProxyPassMatch ^/([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes)/.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/srv/www/domain.com/public_html/$2 ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/srv/www/domain.com/public_html/$1 </IfModule>
Could you please help on looking at this to find out if this is the reason?
I’ve not used PHP-FPM but looking at your setup and the default PHP-FPM used port 9000.
For a test can you try the url with the port number…
https://mainsite.com:9000/subsite/local-signup
otherwise can you “turn off” PHP-FPM to test?
-
This reply was modified 7 years, 11 months ago by
Justin Fletcher.
-
This reply was modified 7 years, 11 months ago by
Justin Fletcher.
The server won’t take a port other than 80 for HTTP request. The port 9000 is only for server side usage. So this URL is rejected by the server.
I post the ProxyPassMatch rules because I hope you could check if the rewrite rules prevent user from requesting to the URI used by this plugin (
/subsite/local-signup/
here). I am afraid I could miss it because I am not so good at URL rewrite rules.Should I create a page including a form inside for register and name/slug this page as
local-signup
? I didn’t read such a requirement in the instructions.Ok, I got it.
I need to,
- Save a copy of
../wp-content/plugins/network-subsite-user-registration/template/page-signup-wp47.php
to my theme folder, such as../wp-content/themes/mytheme/page-signup.php
- Create a new page in the subsite with slug as
local-signup
using the templateSignup Page
and publish it (could just leave the page blank)
Now, when I open register link, it will be redirected to
../subsite/local-signup/
correctly.Thank you for this wonderful plugin. Please add a description on how to use it, at least for people like me ??
-
This reply was modified 7 years, 11 months ago by
Haoxian.
OK glad you got that to work, however, you have a workround since the plugin doesn’t need to have the theme updated that’s if any customization is wanted. The plugin will redirect to the .
/wp-content/plugins/network-subsite-user-registration/template/
location.on your PHP-FPM rewrite rules, I’m not sure you have these correct the
domain.com
seems to generic, unless you have a folder www/domain.com and WordPress installed under there.Either way workarounds do help ?? .. just remember that if I update the plugin then you may need to take another copy of the template for your theme .So if you can get the rewrite rules working that would be better.
I’ll mark this as resolved ( feel free to post a review ?? )
Hi,
The PHP-FPM rewrite rules are just for demonstration purpose. The real ones work well with regular requests.I did try to setup a rule for this plugin like this,
ProxyPassMatch ^/subsite/local-signup/$ fcgi://127.0.0.1:9000/srv/www/domain.com/public_html/wp-content/plugins/network-subsite-user-registration/template/page-signup-wp47.php
But the server threw an error saying the part
fcgi://127.0.0.1:9000/srv/www/domain.com/public_html/wp-content/plugins/network-subsite-user-registration/template/page-signup-wp47.php
is TOO LONG.Then I realised that maybe I should setup a custom page for the login. And it works.
Do you think there is an implementation of redirecting inside this plugin to avoid a hardcoded redirecting from the server side?
Thanks for the advice. I’ll update the template once there is an update to this plugin.
-
This reply was modified 7 years, 11 months ago by
Haoxian.
I think I agree with your question …
Do you think there is an implementation of redirecting inside this plugin to avoid a hardcoded redirecting from the server side?
Just to let you know I’m working on a different approach to landing on the template using redirects within the plugin. When I have something ready I’ll let you know and you can test it on your host. -
This reply was modified 7 years, 11 months ago by
- The topic ‘404 error on registration’ is closed to new replies.