[Solved] Problems with api submissions error on submissions page

Dear @ctgraham and others!

Thank you @ctgraham for your help an patience!

I have solved this issue. I added mod_rewrite logging and got this error log when approaching the submissions page:

[Wed Feb 20 07:59:29.400006 2019] [rewrite:trace3] [pid 9527] mod_rewrite.c(470): [client x.x.x.x:3883] x.x.x.x - - [mydomain.se/sid#55cd7477b9b8][rid#55cd74992b80/initial] [perdir /var/www/html/] add path info postfix: /var/www/html/mydomain -> /var/www/html/mydomain/api/v1/_submissions, referer: https://mydomain.se/submissions
[Wed Feb 20 07:59:29.400075 2019] [rewrite:trace3] [pid 9527] mod_rewrite.c(470): [client x.x.x.x:3883] x.x.x.x - - [mydomain.se/sid#55cd7477b9b8][rid#55cd74992b80/initial] [perdir /var/www/html/] strip per-dir prefix: /var/www/html/mydomain/api/v1/_submissions -> mydomain/api/v1/_submissions, referer: https://mydomain.se/submissions
[Wed Feb 20 07:59:29.400083 2019] [rewrite:trace3] [pid 9527] mod_rewrite.c(470): [client x.x.x.x:3883] x.x.x.x - - [mydomain.se/sid#55cd7477b9b8][rid#55cd74992b80/initial] [perdir /var/www/html/] applying pattern '^(.*)$' to uri 'mydomain/api/v1/_submissions', referer: https://mydomain.se/submissions
[Wed Feb 20 07:59:29.400123 2019] [rewrite:trace4] [pid 9527] mod_rewrite.c(470): [client x.x.x.x:3883] x.x.x.x - - [mydomain.se/sid#55cd7477b9b8][rid#55cd74992b80/initial] [perdir /var/www/html/] RewriteCond: input='/mydomain/api/v1/_submissions' pattern='!/index.php/' => matched, referer: https://mydomain.se/submissions
[Wed Feb 20 07:59:29.400137 2019] [rewrite:trace4] [pid 9527] mod_rewrite.c(470): [client x.x.x.x:3883] x.x.x.x - - [mydomain.se/sid#55cd7477b9b8][rid#55cd74992b80/initial] [perdir /var/www/html/] RewriteCond: input='/var/www/html//mydomain/api/v1/_submissions' pattern='!-f' => matched, referer: https://mydomain.se/submissions
[Wed Feb 20 07:59:29.400146 2019] [rewrite:trace2] [pid 9527] mod_rewrite.c(470): [client x.x.x.x:3883] x.x.x.x - - [mydomain.se/sid#55cd7477b9b8][rid#55cd74992b80/initial] [perdir /var/www/html/] rewrite 'mydomain/api/v1/_submissions' -> 'index.php/mydomain/mydomain/api/v1/_submissions', referer: https://mydomain.se/submissions
...

It looks like the Rewrite-rules are adding “mydomain” to the URI multiple times.
I modified my apache conf-file by adding a RewriteCond to look for “mydomain” in the address.
Now my .conf file looks like this:

<VirtualHost *:443>
ServerName mydomain.se
DocumentRoot "/var/www/html/"
<Directory /var/www/html>
    AllowOverride None
    Options Indexes FollowSymLinks MultiViews
    Require all granted
    DirectoryIndex index.php
    RewriteEngine on
    RewriteBase /
    # If the URI already has index.php in it, don't change it
    RewriteCond %{REQUEST_URI} !/index.php/
    RewriteCond %{REQUEST_URI} !/mydomain/
    # Skip existing directories if Apache 2.2 or later
    #RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
    # Skip existing files if Apache 2.2 or later
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
    # Rewrite all other requests to a specific journal in OJS
    RewriteRule ^(.*)$ index.php/mydomain/$1 [QSA,L]

    # If the URI already has index.php in it, don't change it
    RewriteCond %{REQUEST_URI} !/index.php/
    RewriteCond %{REQUEST_URI} /mydomain/
    # Skip existing directories if Apache 2.2 or later
    #RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
    # Skip existing files if Apache 2.2 or later
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
    # Rewrite all other requests to a specific journal in OJS
    RewriteRule ^mydomain(.*)$ index.php/mydomain/$1 [QSA,L]
</Directory>

## Logging
 ErrorLog "/var/log/httpd/mydomain.se:443_error_ssl.log"
 ServerSignature Off
 CustomLog "/var/log/httpd/mydomain.se:443_access_ssl.log" combined
## Header rules
## as per http://httpd.apache.org/docs/2.2/mod/mod_headers.html#header
 Header Set Strict-Transport-Security "max-age=31536000"

## SSL directives
...
</VirtualHost>
1 Like