prestoav Posted December 20, 2024 Share Posted December 20, 2024 (edited) Hi all and seasons greetings! I have a problem that's driving me a bit mad and wondered if anyone in this wonderful community can throw any light on it. I have three copies of the same site, a marketplace where registered users can add listings. The copies are localhost (on MAMP), development, and live (www). All copies are running: PW 3.0.229 PHP 8.08 All copies are also running a duplicate set of /site/ and /wire/ files. The live and development copies are running on the same server. On one copy of the site (annoyingly the live one...) I cannot access the admin login page directly. I have '/admin/' setup as the admin page. Whenever I try the url - 'www.thesite.com/admin/' it diverts to the root page of the site 'www.thesite.com'. As it's a marketplace, I can access the admin by first using the 'public' login screen for members then pasting 'www.thesite.com/admin/' into the URL bar. This redirects to www.thesite.com/admin/page as you'd expect. When I logout again the system diverts to the root page of the site rather than the admin login page. Since I can login on the user facing login page, and the logout function diverts to the root of the website rather than the admin login page, I'm thinking the issue is with the login page / login process. I'm not familiar with how this works but I have compared the /wire/Modules/Process/ProcessLogin/ folders and they look to be the same (and file sizes report the same). I should also say that all other admin functions work fine once logged in. The only difference between the three sites I can think of is the database as the live one has all the latest listings in etc. Does anyone have ideas as to what might be causing this, or could explain how the login process works? As always, any help is really appreciated! Edited December 20, 2024 by prestoav Solved Link to comment Share on other sites More sharing options...
da² Posted December 20, 2024 Share Posted December 20, 2024 (edited) Hi, My first though is about .htaccess. Is it the original one? Does the web server process it correctly and does the server have more rules (redirections...) that could interfere with the PW .htaccess rules? 22 minutes ago, prestoav said: Whenever I try the url - 'www.thesite.com/admin/' it diverts to the root page of the site 'www.thesite.com'. Could it be related with the 404 page configuration in config? $config->http404PageID = 27; Also check that no hook is doing that redirection, like a hook that would say: "redirect normal and guest user to home page if they try to access admin"? ^^ Edited December 20, 2024 by da² 1 Link to comment Share on other sites More sharing options...
prestoav Posted December 20, 2024 Author Share Posted December 20, 2024 Hi @da² thanks for your thoughts. .htaccess - The .htaccess files is a direct copy of the working one on the development installation (i copied it over earlier today to be sure) so I don't think that's it. 404 in config - there wasn't one in the config file so I added the once you stated above and now on logout I get a redirect to 'mysite.com/admin/login/logout/' which throws a 'this page isn't working' error. That's new so you might be on to something? Hooks - the only hook in the ready.php is the standard one for logging sent emails and that has no redirects in it so I think we can rule that out too :-( Link to comment Share on other sites More sharing options...
prestoav Posted December 20, 2024 Author Share Posted December 20, 2024 2 minutes ago, prestoav said: 404 in config - there wasn't one in the config file so I added the once you stated above and now on logout I get a redirect to 'mysite.com/admin/login/logout/' which throws a 'this page isn't working' error. That's new so you might be on to something? Actually, scrub that. There was a typo in what I added. Now corrected and we're back to the original result. Logging out redirects to the root page rather than the login screen. Link to comment Share on other sites More sharing options...
prestoav Posted December 20, 2024 Author Share Posted December 20, 2024 OK, solved it. For some reason the admin template was setup correctly. Templates > admin > access should be set like this: Mine was set to option C which meant, as a 'guest' before logging in, I had no permission to see the admin login page and was redirected to the main root of the site. Phew! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now