Remove index.php from URL

For Apache HTTP server, this can be done by turning on the URL rewriting engine and specifying some rewriting rules.
Create .htaccess file and located it under project folder in webroot.

RewriteEngine on

\# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

\# otherwise forward it to index.php
RewriteRule . index.php

Add a Comment