Hiding .html extension

Hi There, is there a way to generate URLs without their .html extensions? Like that one: https://katharina-lewald.de/arbeite-mit-mir

Not a must, but looks more professional.

Thanks, c.

There are a couple options. The more complex one is a custom configuration of the web server. For example placing this in the .htaccess file should do it:

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}.html -f 
RewriteRule ^(.*)$ $1.html

However this is tricky and it’s easy to break the website. Also since it’s not directly supported in Sparkle, the page will still be indexed with the .html extension by search engines.

Another option is what we put in this documentation article:

https://sparkleapp.com/docs/how-to-create-clean-navigation-urls.html

3 Likes