Remove index.php from URL using htaccess
Many PHP developers find it difficult to remove index.php from URL. The best way is to use .htaccess file in your root directory.
mod_rewrite must be enable with php and this will work for the php version higher than 5.2.6
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?/$1 [L]
PHP version less than 5.2.6 try this
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L]
Save the .htaccess file. We hope the above changes to the htaccess file can help you to remove the index.php from your URL. You can use the above method for any CMS like Joomla, Magento or WordPress.
If you need any help on this then feel free to contact us. Our experienced developers will help you fix the issue.

Written by
Abhilash Sahoo
Abhilash Sahoo, with over 16 years of experience, is Founder & CEO of Infyways Solutions. He builds web platforms and eCommerce on Joomla, WordPress, Shopify, Magento, and OpenCart, plus modern stacks like Next.js, React, Node.js, and Python, with AI agents, automation, and headless CMS when products need to scale.
Keep reading
![[Fixed] MySQL Database not running XAMPP 7.2.31 macOS](/_next/image/?url=https%3A%2F%2Fdata.infyways.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fmysq-not-running-xampp.png&w=3840&q=75)
