r/web_programming • • Jun 15 '16

Removing the .html extension

So I've done a little research myself and everything points to the fact that I need to create a .htaccess file. I've created it, named it, and put it in the folder with the other .html pages but it's not working. Here is what is in the file.

Options +MultiViews

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule [^.]+$ $1.php [NC,L]

RewriteRule [^.]+$ $1.html [NC,L]

Any ideas? I'm a super novice in this stuff.

4 Upvotes

4 comments sorted by

1

u/adrian_the_developer Jun 16 '16

Try calling it either index.html or index.php.

1

u/RedBlimp Jun 16 '16

I'm not sure what you mean. I already have the main webpage named as index.html.

1

u/adrian_the_developer Jun 16 '16

I'm an idiot. I honestly don't know. I've tried doing rule rewrites before, but either sending or receiving, it messed up.

1

u/RedBlimp Jun 16 '16

Well I appreciate you trying to help either way.