The requested URL was not recognized when I create a new magazine

Hi, when I set up a new magazine I always get a warning with the message: the requested URL was not recognized.

Software version: ojs-3.2.1-2
Description:

Public path:
Ojs is installed on “/var/www/vhosts/criticae.es/httpdocs”

Files dir:
files_dir = “/var/www/vhosts/criticae.es/files”

alert

OJS is configured with the basic settings I entered in the installation, does anyone know why it happens?

Hi @RicardoChiralt,

Please be careful not to put files_dir inside your web root unless you have protected it from direct access via the web server! It is a potential security risk. See the “Recommended Configuration” section of docs/README.md.

To debug the unrecognized URL message, I would recommend using your web browser’s developer tools to check what URL is being requested when this response is returned. Depending on your browser, you can likely see this on the “Network” tab of the developer tools.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher, the “files” folder is not in the public directory, on my server the folders would look like this:

files_dir = “/var/www/www/vhosts/criticae.es/files”
OJS (public folder) = “/var/www/vhosts/criticae.es/httpdocs”

I just looked at the browser console and when I get the warning “The requested URL was not recognized” in console appears:

[Error] Failed to load resource: the server responded with a status of 403 (Forbidden) (index.php, line 0)
https://criticae.es/index.php?journal=*&endpoint=/*/api/v1/contexts

{
“error”: “api.404.endpointNotFound”,
“errorMessage”: “La URL solicitada no fue reconocida.”
}

Do you know what this may refer to?

Hi @RicardoChiralt ,

the “files” folder is not in the public directory

Great, just making sure!

[Error] Failed to load resource: the server responded with a status of 403 (Forbidden) (index.php, line 0)
[https://criticae.es/index.php?journal=*&endpoint=/*/api/v1/contexts](https://criticae.es/index.php?journal=%2A&endpoint=/*/api/v1/contexts)

It looks like you have disable_path_info set to On in your config.inc.php; I’d recommend turning it Off. This option is deprecated and will be removed in the future.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hello, thank you very much for your help. I have changed the value of the disable_path_info variable to Off, however now when I access the main OJS url the browser automatically redirects to the url “https://criticae.es/admin/contexts” generating a 404 error.

My PHP configuration is:

Version: 7.3.25
App: FPM

I commented out the base_url[index] variable and now it seems to work perfectly.

Thank you very much for your help.

1 Like