Omeka S is installed, PHP works, but every omeka URL resolves to “File not found.”

I’m moving my Omeka S instance from a hoster to another. After transferring the content, and restoring the dumped database, it looks like every omeka URL resolves to “File not found.”

What could cause this error?

I’ve checked that .htaccess is correct. It look like AllowOverride is enabled (tough I can’t really be sure of that). Root page, and admin page show the same error, like any other unexisting page (random url).

I’ve just found out the following error:

example.org [Thu Nov 09 10:42:35.144751 2023] [fastcgi:error] [pid 8980:tid 140396642334464] [client 193.33.56.135:0] FastCGI: server “/home/clients/87af2e1106916e/.config/apache/example.org/.fpm/php5.external” stderr: Primary script unknown

After asking to my hoster support, it appears that they found an error in the default .htaccess file of Omeka S:

RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]

RewriteCond %{ENV:REDIRECT_OMEKA_REQ} !"1" 
RewriteRule ^(.*)$ %{ENV:BASE}/index.php [E=OMEKA_REQ:"1",L]

The first instruction set is creating the BASE variable. The second instruction set redirects index.php toward this BASE which does not exist.

Omeka works again when changing the .htaccess file as follows:

-RewriteRule ^(.*)$ %{ENV:BASE}/index.php [E=OMEKA_REQ:"1",L]
+RewriteRule ^(.*)$ index.php [E=OMEKA_REQ:"1",L]

Do you have an opinion on this error, and on the fix?

I think we’ve seen issues before with a very small number of servers working with the default .htaccess. The purpose of the more complex default rules are to automatically handle servers where the base URL is not typical.

If Omeka S is working fine with the change you showed here, it shouldn’t be an issue.