Step 1. Enable mod_rewrite on your Apache web server.
Step 2. Create .htaccess file in root directory.
Step 3. Remove index.php by htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
</IfModule>
Step 4. Restart Apache Server
sudo service apache2 restart
Copyright ©2022 coderraj.com. All Rights Reserved.