To enable RESTful URLs on OJS3, and change localhost/index.php/journal to localhost/journal I did:
Change restful_urls to “On” in the config.inc.php file.
; Generate RESTful URLs using mod_rewrite. This requires the
; rewrite directive to be enabled in your .htaccess or httpd.conf.
; See FAQ for more details.
;restful_urls = Off
restful_urls = On
Add the rewrite rules on ssl.conf or httpd.conf inside de virtualhost configuration:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/api
RewriteCond %{REQUEST_URI} !^/cache
RewriteCond %{REQUEST_URI} !^/classes
RewriteCond %{REQUEST_URI} !^/controllers
RewriteCond %{REQUEST_URI} !^/dbscripts
RewriteCond %{REQUEST_URI} !^/docs
RewriteCond %{REQUEST_URI} !^/js
RewriteCond %{REQUEST_URI} !^/lib
RewriteCond %{REQUEST_URI} !^/locale
RewriteCond %{REQUEST_URI} !^/node_modules
RewriteCond %{REQUEST_URI} !^/pages
RewriteCond %{REQUEST_URI} !^/plugins
RewriteCond %{REQUEST_URI} !^/public
RewriteCond %{REQUEST_URI} !^/registry
RewriteCond %{REQUEST_URI} !^/styles
RewriteCond %{REQUEST_URI} !^/templates
RewriteCond %{REQUEST_URI} !^/tests
RewriteCond %{REQUEST_URI} !^/tools
RewriteCond %{REQUEST_URI} !^.*/index.php/.*$
RewriteRule ^(.*)/?$ /index.php/$1 [QSA,L]
I decided to post this configuration because I did not find these rules in other topics.
Without the RewriteCond some functionality as the journals logos in the “public” folder did not work.
Does anyone see any problems in them?