gizomo Posted September 26, 2017 Share Posted September 26, 2017 I installed PW without any errors. The frontend works fine. But when going to the backend the site just returns me to home page and change url to http://domain.com/?/admin/. The link "Admin login" is http://domain.com/admin/ Apache reads .htaccess correctly. Link to comment Share on other sites More sharing options...
abdus Posted September 26, 2017 Share Posted September 26, 2017 I'm not experinced in Apache, but it looks like apache rewrites url incorrectly. There should be a .htaccess file on the root directory of PW and inside it you should see # ----------------------------------------------------------------------------------------------- # 19. Pass control to ProcessWire if all the above directives allow us to this point. # For regular VirtualHosts (most installs) # ----------------------------------------------------------------------------------------------- RewriteRule ^(.*)$ index.php?it=$1 [L,QSA] # ----------------------------------------------------------------------------------------------- # 20. If using VirtualDocumentRoot (500 NOTE): comment out the one above and use this one instead # ----------------------------------------------------------------------------------------------- # RewriteRule ^(.*)$ /index.php?it=$1 [L,QSA] If it's still not working rewrite module may not be activated https://stackoverflow.com/a/5758551 Link to comment Share on other sites More sharing options...
EntitySelf Posted September 26, 2017 Share Posted September 26, 2017 Has it ever worked? Are you redirected after you enter your credentials or even before that? If you can browse the front site then the .htaccess & mod_rewrite should be working right? Link to comment Share on other sites More sharing options...
abdus Posted September 26, 2017 Share Posted September 26, 2017 If the rewrite isn't working you wont even get to the login form, it just redirects back to homepage like you've been experiencing Link to comment Share on other sites More sharing options...
gizomo Posted September 26, 2017 Author Share Posted September 26, 2017 I have only one .htaccess file on the root of PW. Where should another one be placed? Link to comment Share on other sites More sharing options...
EntitySelf Posted September 26, 2017 Share Posted September 26, 2017 You only need one in the root, so that is fine. Link to comment Share on other sites More sharing options...
gizomo Posted September 26, 2017 Author Share Posted September 26, 2017 The login form doesn't appear. Site loads home page. Link to comment Share on other sites More sharing options...
abdus Posted September 26, 2017 Share Posted September 26, 2017 That should be enough to get rewrite working, but as it's not working then most likely rewrite isn't enabled/.htaccess isn't parsed by apache. Link to comment Share on other sites More sharing options...
pwired Posted September 26, 2017 Share Posted September 26, 2017 He didn't mean a second .htaccess file but that there should be one in the root. Link to comment Share on other sites More sharing options...
abdus Posted September 26, 2017 Share Posted September 26, 2017 Quote Upload a file called info.php with this code and run it: <?php phpinfo(); Search for mod_rewrite on the page, and see if you can find it under Loaded Modules. https://stackoverflow.com/a/14294970 Link to comment Share on other sites More sharing options...
gizomo Posted September 26, 2017 Author Share Posted September 26, 2017 I don't understand why the "?" is appeared in the url. I guess the mod_rewrite works but wrong. Link to comment Share on other sites More sharing options...
gizomo Posted September 26, 2017 Author Share Posted September 26, 2017 Phpinfo said HTTP_MOD_REWRITE On Link to comment Share on other sites More sharing options...
abdus Posted September 26, 2017 Share Posted September 26, 2017 Then .htaccess isn't read at all by apache. You may need to allow overrides. https://askubuntu.com/a/465589 Link to comment Share on other sites More sharing options...
gizomo Posted September 26, 2017 Author Share Posted September 26, 2017 I've already checked this. AllowOverride all Link to comment Share on other sites More sharing options...
EntitySelf Posted September 26, 2017 Share Posted September 26, 2017 Can you tell us something about the environment, it's Apache on a dev machine or web hosting company ? Can you post version numbers, PHP, Apache, PW, whatever might be handy, did you edit anything after you installed? Did you try another browser or clear cookies, any browser plugins that might affect it? I did disable mod_rewrite for a moment on my dev machine and still see the login form, just can't login. Link to comment Share on other sites More sharing options...
abdus Posted September 26, 2017 Share Posted September 26, 2017 Open .htaccess file and smash your keyboard, save the file, refresh your browser, if you get an error, then .htaccess is working too. https://stackoverflow.com/a/17250196 Link to comment Share on other sites More sharing options...
gizomo Posted September 26, 2017 Author Share Posted September 26, 2017 Its my server. PW is 3.0.62 Link to comment Share on other sites More sharing options...
gizomo Posted September 26, 2017 Author Share Posted September 26, 2017 I've tried to add gibberish to the .htaccess file. Server returns 500 error. Link to comment Share on other sites More sharing options...
EntitySelf Posted September 26, 2017 Share Posted September 26, 2017 And check /site/assets/logs as well, maybe there is a hint... Link to comment Share on other sites More sharing options...
pwired Posted September 26, 2017 Share Posted September 26, 2017 You should have this in your .htaccess file to get rid of the ? in your urls: RewriteCond %{THE_REQUEST} ^.*/index.php RewriteRule ^(.*)index.php$ /$1 [R=301,L] Link to comment Share on other sites More sharing options...
abdus Posted September 26, 2017 Share Posted September 26, 2017 Well, then then I'm back to suggest checking .htaccess rule 19. This has to work for PW to handle requests to pages other than homepage. # ----------------------------------------------------------------------------------------------- # 19. Pass control to ProcessWire if all the above directives allow us to this point. # For regular VirtualHosts (most installs) # ----------------------------------------------------------------------------------------------- RewriteRule ^(.*)$ index.php?it=$1 [L,QSA] # ----------------------------------------------------------------------------------------------- # 20. If using VirtualDocumentRoot (500 NOTE): comment out the one above and use this one instead # ----------------------------------------------------------------------------------------------- # RewriteRule ^(.*)$ /index.php?it=$1 [L,QSA] </IfModule> ################################################################################################# # END PROCESSWIRE HTACCESS DIRECTIVES ################################################################################################# Link to comment Share on other sites More sharing options...
abdus Posted September 26, 2017 Share Posted September 26, 2017 Also, find your apache access logs, check whether rewritten urls has ?it=/admin/ in it Link to comment Share on other sites More sharing options...
pwired Posted September 26, 2017 Share Posted September 26, 2017 Check this also: https://processwire.com/docs/tutorials/troubleshooting-guide/ Link to comment Share on other sites More sharing options...
gizomo Posted September 26, 2017 Author Share Posted September 26, 2017 I tried to rename .htaccess file. Site loads only home page. Other requests return 404 error. The request to admin page keeps on returning home page with /?/admin/ at the url of the page. Link to comment Share on other sites More sharing options...
EntitySelf Posted September 26, 2017 Share Posted September 26, 2017 Strange, When I do that I get a 404 on /admin/ as well... maybe reinstall PW and try changing the /admin/ to something else, just as a test? What are you using as a platform, I use wampserver on Windows? 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