There is a setting called “restful_urls” in config.inc.php which allows removal of the index.php URL component when accompanied by a mod_rewrite Apache configuration (or similar configuration for your server environment).
Removing all of the REST components as in your Example 1 is a little aggressive. https://moz.com/blog/should-i-change-my-urls-for-seo
It is possible, however, to also create arbitrary vanity URLs such as this via mod_rewrite or similar. You can find a parallel discussion here:
How can I increase the number of characters allowed for the field “PATH” in Journal Settings ? Now, the number of characters allowed is 32 and I need to be 71 characters.
In trying to create the vanity URLs in your second question, you are losing a large amount of RESTful context, and not really gaining substantial SEO improvements.
The initial “index” component of the URL indicates the Site level context for the remainder of the URL, as opposed to a Journal level context, for example.
If you can discriminate between the Site and Journal contexts via the domain name, you can readily remove the “index” context via mod_rewrite and the base_url settings in config.inc.php. For example, this would be the case if you had one site install with two journals, with base urls of:
There is no mechanism in the software to create vanity URLs which automatically strip the RESTful context from pages, but you can create the URL rewrites by adding additional mod_rewrite rules, and then when adding links in the menu or in HTML you would need to manually reference those links. The pages would still be available at their original URI, and could be indexed as such if these links are crawled. I think this would get you 90% of the way there, though I think it would be a lot of effort for minimal benefit.
How can I remove “index.php” from the URLs in OJS?
A: OJS uses a REST-style URL syntax for all of its links. To force OJS to remove the
“index.php” portion of all URLs, edit config.inc.php and set “restful_urls” to “On”.
In addition, your server will have to support URL rewriting in order to recognize
the new URLs. Apache servers use the mod_rewrite plugin, which must be enabled
in your httpd.conf, and the following section added to the correct section of either
your httpd.conf or an .htaccess file (preferred) in your OJS root directory (the same
location as config.inc.php):