DEV Community

HaxNet
HaxNet

Posted on

remove the .html extension

Just put this in your .htaccess file

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.html
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
Enter fullscreen mode Exit fullscreen mode

https://tekniq.xyz and you can click on the month's link without the *.html showing on the url. This makes it much neater.

By the way, my blog is designed to be Lynx Browser friendly. All of my post are done by editing the html file directly. Don't want to use markdown

Top comments (0)