Hiding url link in the adress bar for OJS/PKP

Is there a way to hide some piece of the URL link in the address bar for OJS/PKP to not share the entire chain of folders where some documents are stored in my Journal?

For example, I saved some documents in the /public/journals/1/docs/MyDocument.pdf

In the address bar it’s being displayed like this:
http://myjournal/public/Journals/1/docs/MyDocument.pdf

Is there a way to hidden all the content here, and display the document like this:

http://myjournal/MyDocument.pdf

Is there any workaround that I can apply in OJS/PKP to reach that result?

Thanks!

1 Like

There isn’t a native feature of OJS which can do this, but there are some possible workarounds, each of which will require that you change the link URL via the TinyMCE editor:

  • Create a symbolic link to the journals/1/docs directory off of the OJS installation root. Your file path would then look something like http://myjournal.tld/docs/MyDocument.pdf.
  • Create a URL rewrite (or rewrites) in your webserver configuration. For example, an Apache mod_rewrite could look something like:
RewriteCond public/journals/1/docs/%{REQUEST_URI} -f
RewriteRule (.*) public/journals/1/docs/$1 [F]