Home Page redirects to /index.php/ and returns 404

29 views
Skip to first unread message

Grant Forrest

unread,
Oct 7, 2021, 8:50:30 AM10/7/21
to AtoM Users
Hello All, apologies if this is a really silly question but I've searched the group for answers and can't find any.
After migrating an AtoM 2.5.4 to a new server, everything works okay, except that the home page URL is directing to /index.php/ (note trailing slash) and this is producing a 404.
If I remove the trailing slash, it returns the page (200)
I'm not sure where this '/' is appended from - all other URLs have it, as presumably it passes arguments for the search.
Could it be my nginx conf?
Happy to copy the setup.

Dan Gillean

unread,
Oct 7, 2021, 12:33:38 PM10/7/21
to ICA-AtoM Users
Hi Grant, 

First thing I would recommend checking would be your base URL in Admin > Settings > Site information. Make sure there's not a trailing slash added to the base URL there! 

It may be Nginx configuration related - however, as far as I know, if you've used our default recommended configuration block, then this shouldn't be a problem. 

It is possible to adjust the configuration so that index.php is not appended to URIs however. There's an older post in the forum that mentions this here: 
 Be sure to restart PHP-FPM and clear all caches after making any changes to the configuration files! 

Let us know if this helps. 

Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him


--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/2818f017-5b78-42d6-b624-c0b4f2caa05en%40googlegroups.com.

Grant Forrest

unread,
Oct 7, 2021, 5:37:02 PM10/7/21
to AtoM Users
Hi Dan, thanks as always for your time and eyes on this.
I think I've tracked the problem down to the nginx server block. It looks as though the migrators were having trouble getting Nginx and PHP to play together as they'd added this code:
location ~ \.php(/|$) {
    try_files $uri $fastcgi_script_name =404;
    #try_files $uri /index.php?$args;
    fastcgi_pass unix:/var/php-nginx/162973199796742.sock/socket;
  }
  fastcgi_split_path_info ^(.+\.php)(/.+)$;
  
  location / {
    try_files $uri /index.php?$args;
    }

In the course of fixing it, I've come to understand that the AtoM documentation for php-fpm is fairly clear about only requiring the last code block for the virtual server to work.
I can see in the Nginx documentation that it advises a different method for serving PHP files, so it's a small source of wonder that all you need in the block is:
  location / {
    try_files $uri /index.php?$args;
    }

and that's it!
Took me a while to figure this out so no disrespect to someone coming at it from first principles.
Keep up the great work :)
Grant
Reply all
Reply to author
Forward
0 new messages