Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save webmechanicx/894ab24d6bb71718a21a78de6df1d781 to your computer and use it in GitHub Desktop.
Save webmechanicx/894ab24d6bb71718a21a78de6df1d781 to your computer and use it in GitHub Desktop.
Remove of index.php in your Joomla! URLs
## To remove the /index.php/ part from all URLs, add two lines after the RewriteEngine statement:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/index\.php/
RewriteRule ^index.php/(.*) /$1 [R,L]
## You can also add two lines to remove the .html suffix if it has been turned on before:
RewriteEngine On
RewriteCond %{REQUEST_URI} \.html$
RewriteRule (.*)\.html$ /$1 [R,L]
## Adding the .html suffix
RewriteCond %{REQUEST_URI} !\.html$
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_FILENAME} !index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /$1.html [R,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment