How to remove index.php in ojs 3.0.2.0

With OJS 3.1.1.2 there will be errors if you use the settings I posted above. These are the ##api.submissions.unkownError## errors that a lot of users have encountered.

This is the new config that seems to work.

RewriteEngine On
RewriteBase /

# List of actual folders I want to access (like http://mydomain.com/folder1/)
RewriteRule ^(folder1|folder2|folder3)($|/) - [L]

# Redirect www.mydomain.com to mydomain.com
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# Remove index.php
RewriteCond %{SERVER_NAME} ^mydomain.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]

# Handle api calls in subdomains
RewriteCond %{SERVER_NAME} ^([a-z0-9-]+)\.mydomain\.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} api\/v1\/
RewriteRule ^(.*)$ index.php/%1/$1 [L]

# Handle subdomains
RewriteCond %{SERVER_NAME} ^([a-z0-9-]+)\.mydomain\.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/%1/$1 [L]
2 Likes