Do this:
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
Related Contents:
- Reference: mod_rewrite, URL rewriting and “pretty links” explained
- Remove .php extension with .htaccess
- Tips for debugging .htaccess rewrite rules
- How to enable mod_rewrite for Apache 2.2
- htaccess redirect to https://www
- How to debug Apache mod_rewrite
- apache redirect from non www to www
- htaccess remove index.php from url
- How to hide the .html extension with Apache mod_rewrite
- RewriteRule Last [L] flag not working?
- Removing the .php extension with mod_rewrite
- Hidden features of mod_rewrite
- Rewriting an arbitrary number of path segments to query parameters
- What does RewriteBase do and how to use it?
- How to debug .htaccess RewriteRule not working
- How to force https on elastic beanstalk?
- Forbidden You don’t have permission to access / on this server [closed]
- .htaccess rewrite query string as path
- How to redirect URLs based on query string?
- How do I ignore a directory in mod_rewrite?
- Case Insensitive URLs with mod_rewrite
- CSS, JS and images do not display with pretty url
- mod_rewrite: remove trailing slash (only one!)
- Mod_Rewrite unexpected behavior L flag
- .htaccess rewrite “/book.php?id=1234” to “/book/1234”
- Redirect to Apache built-in 404 page with mod_rewrite?
- Apache rewrite based on subdomain
- How to encode special characters using mod_rewrite & Apache?
- AH10411 error: Managing spaces and %20 in apache mod_rewrite
- rewrite rules for apache 2 to use with angular js
- Multiple RewriteRules for single RewriteCond in .htaccess
- Error message “Forbidden You don’t have permission to access / on this server” [closed]
- How to prevent http file caching in Apache httpd (MAMP)
- Apache redirect to another port
- Redirect site with .htaccess but exclude one folder
- How can I implement rate limiting with Apache? (requests per second)
- Pretty URLs with .htaccess
- How to CORS-enable Apache web server (including preflight and custom headers)?
- How can I match query string variables with mod_rewrite?
- Yii2 htaccess – How to hide frontend/web and backend/web COMPLETELY
- Difference between the Apache HTTP Server and Apache Tomcat? [closed]
- What is apache’s maximum url length?
- WAMP 403 Forbidden message on Windows 7
- How to make static content on Apache be cached by browser and not checked for freshness with every request?
- How to use vhosts alongside node-http-proxy?
- Obsolete cryptography warning from Browser
- Apache Server (xampp) doesn’t run on Windows 10 (Port 80)
- apache mod_rewrite one rule for any number of possibilities
- Apache default VirtualHost
- How to force Apache to use manually pre-compressed gz file of CSS and JS files?