I want to hide those .html
extensions in the url. Is it possible? How can I hide them?
Asked
Active
Viewed 1,437 times
0

Jason Aller
- 3,541
- 28
- 38
- 38

Istiack Mohammad
- 13
- 5
-
6Does your server support .htaccess files? – Volper Dec 17 '19 at 18:45
-
Does this answer your question? [How to remove .html from URL?](https://stackoverflow.com/questions/5730092/how-to-remove-html-from-url) – henriquehbr Dec 17 '19 at 19:34
-
don't get why it was downvoted... when googling it was the first result opposed to the duplicated question – Konrad May 29 '20 at 08:34
1 Answers
3
If you want to remove the .html
extension from a html file for example yoursite.com/wallpaper.html
to yoursite.com/wallpaper
you have to add the following code inside the .htaccess
file:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]

henriquehbr
- 1,063
- 4
- 20
- 41

Ando
- 56
- 2