MMM
MMM

Reputation: 345

HTML and HTAccess

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: enter image description here

Here is my code that works fine using .html enter image description here

So I went into sublime text and posted the same code into a .htaccess file as shown here (also in my directory first pic): enter image description here

I then changed my links and removed .html enter image description here

But I get an error enter image description here

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

Answers (2)

Fabian Barney
Fabian Barney

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

Clonkex
Clonkex

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

Related Questions