FINAL DESIGN STUDIOS
FDS Services | FDS Repository | Search our Services | Bookmark FDSFDS London UK


Removing trailing index.php from URL – HTACCESS rewrite Rule

Print This Post Print This Post Email This Post Email This Post

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.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*

*