Removing trailing index.php from URL – HTACCESS rewrite Rule
Trailing URLs such as ending with index.php or index.hlml is not a big deal, however you may find that you’re sharing the link juice across 2 identical ‘sources’. Best to simply remove the trailing index reference altogether and redirect any traffic to it, to the directory root instead.
RewriteCond %{THE_REQUEST} ^GET\ /.*/index\.(php|html)\ HTTP
RewriteRule (.*)index\.(php|html)$ /$1 [R=301,L]
Job done.
You must be logged in to post a comment.
Recent Posts
- Embrace ChatGPT SEO Now to Future-Proof Your Website with AI Agent Integration
- Key Steps to Avoid Losing Ground with SEO 2.0: AISEO
- AI Optimisation: Why Your Website Needs Structured Data for Agent-to-Agent Search
- Google Search Generative Experience (SGE): A Game Changer for Businesses
- WordPress 4.8.2 – Security & Maintenance Update


