You are viewing the PKP Support Forum | PKP Home Wiki

Blank pages (translator plugin) when restful urls are on

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

Blank pages (translator plugin) when restful urls are on

Postby evan » Mon Jun 03, 2013 4:32 am

Recently after enabling restful urls to our OCS installation on the production server, we run into a problem.
All the second level pagers of the translator plugin, lead to non existent urls and thus to not found pages. After some research, I've come to conclude that the problem lies in the apache rewriting rules, that cannot handle the requested urls.

In our case an url that's not working is something like this
Code: Select all

The rewrite rules that are necessary for clean urls to work, are as suggested in an older thread (viewtopic.php?f=2&t=2616)

Code: Select all
Options all -Indexes
AllowOverride none
<IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ index.php/$1 [QSA,L]

The above configuration lies in the ocs virtual host of the server (we are not using .htaccess file).
On the other hand the localeFile.tpl template file that creates the pager links, performs two times an
Code: Select all
on the filename, so the slashes are converted to %252F.

All the trial and error attempts I conducted on the rewrite rules did not have any result, so any suggestion would be greatly welcomed.

Posts: 9
Joined: Tue May 29, 2012 4:14 am

Re: Blank pages (translator plugin) when restful urls are on

Postby evan » Wed Jun 12, 2013 3:25 am

Hello there,

i finally figured it out. Apache by default denies all urls containing encoded slashes, so all the urls with %252F in the path part, were rejected. So all i did was put the directive AllowEncodedSlashes NoDecode in the virtual host file, to inform apache not to touch the requested url, and everything worked fine.

This option is recommended in the apache documentation, as encoded slashes may raise security issues. But i still do not understand the need for those two times encoded slashes in the urls of the translator plugin.

Hope this helps

Posts: 9
Joined: Tue May 29, 2012 4:14 am

Return to OCS Technical Support

Who is online

Users browsing this forum: Google [Bot] and 1 guest