How to remove index.php in the URL


How to remove index.php from URL. Like

I have gone through some posts, but none of them are straight and clear.

Hi @Psek,

Check this How To Rewrite URLs with mod_rewrite for Apache on Ubuntu 16.04 | DigitalOcean

You have to use rewrite, then turn on restful_urls option in file.


Root access is needed to enable mod_rewrite. Service provider says it is enabled by default. But after modifying the .htaccess and config.php also, i could not remove index.php from URL

@Psek , set restful_urls = On at, create a .htaccess with

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.php/$1 [L]

and at apache 000-default.conf set:

<Directory /var/www/html/ojs>
                Options Indexes FollowSymLinks
                AllowOverride All
                Require all granted

It’s work to me =]

Hello, just commenting on the information. If you are using OJS the apache SSL secure mode. These rules must be applied on VirtualHost *:443 and not on port 80.