Blog

November 9, 2023

Filipino developer having a hard time with their code
(Fictional) me having to retrace my footsteps when I first did the Hostinger-VS Code-Github connection. Image generated by Dall-E 3 via Bing.


Update 33. 3:33pm. I realized that I lost the .htaccess file in my main folder. I learned previously that .htaccess files simply put instructs servers to behave a certain way.

In this case, I wanted to hide .html in the URL path. To do this, create a file named ".htaccess" and save it on your root directory. Within the file, copy and paste the code below.

Here is the prompt and the corresponding result.

Prompt

create .htaccess so I can add .html in my URL paths


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\.html$ /$1 [L,R=301]
RewriteRule ^([^/]+)/?$ $1.html [L]