Reputation: 345
I have been struggling with this all morning and I have not had much luck.
I am trying to get the following stackoverflow post to work: How to remove .html from URL
Here is my file directory with the htaccess file:
Here is my code that works fine using .html
So I went into sublime text and posted the same code into a .htaccess file as shown here (also in my directory first pic):
I then changed my links and removed .html
If anyone could please tell me what I'm doing wrong I would be grateful! Been bashing my head on this all morning
Upvotes: 1
Views: 721
Reputation: 14549
.htaccess
is used by Apache Webserver. You must install and configure an Apache Webserver and access your site through http://localhost
for example.
Currently your .htaccess
is completely ignored until your site is served by Apache.
Upvotes: 0
Reputation: 3637
.htaccess
is a file used to control access for Apache web servers. It won't affect anything unless you're running and accessing an Apache server. From your screenshots I can see that you're directly opening a file from your hard drive.
Your browser is saying File not found
because you're trying to access a non-existent file. The address bar in your browser should say this:
file:///Users/mikegeng/Documents/GitHub/MichaelGeng.github.io/index.html
Upvotes: 2