Categories: Tutorial

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.

Abhilash Sahoo

Abhilash Sahoo, with 14 years of experience, is a Certified Joomla and WordPress Expert and the Founder & CEO of Infyways Solutions, specializing in innovative web development solutions.

Share
Published by
Abhilash Sahoo

Recent Posts

HubSpot vs WordPress: A Comparison Overview of Popular CMSs.

HubSpot vs WordPress? What best? Indeed, for more than ten years, WordPress has been the…

3 months ago

Boost Your Website’s Performance with Expert WordPress Speed Optimization Services

WordPress Speed Optimization Services for Website maintenance is a full-time job. Apart from introducing new…

3 months ago

Fixing There Has Been A Critical Error On This Website WordPress

Nothing is more terrifying than when your WordPress website is going down, especially when you…

4 months ago

WordPress vs Ghost: Exploring the Differences!

WordPress vs Ghost, who wins actually? Despite its current position as the world's leading content…

4 months ago

Top WordPress Security Services Providers in 2023

The security and safety of any website are essential for its health and well-being. The…

4 months ago

Top 12 WordPress Website Management Tools for 2023

Let's explore the definition of WordPress Website Management Tools before moving on to the finest…

6 months ago