0

I was trying to get rid of the index.html in my url.

.htaccess

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://saturnstudios.org/$1 [R,L]

Everytime I load the website https://www.saturnstudios.org/index I get the error Error 404 - Not Found The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.

Even though the documents are named right.

enter image description here

<h1 class="nav-link"><a href="index">Home</a></h1>
</li>
<li>
   <h1 class="nav-link"><a href="about">About</a></h1>
</li>
<li>
<h1 class="nav-link"><a href="contact">Contact</a></h1>

Any ideas of how to fix it?

z3nth10n
  • 2,341
  • 2
  • 25
  • 49
HexMania Hexy
  • 35
  • 1
  • 6

2 Answers2

1

You can try to remove .html extension from url with this:

RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule !.*\.html$ %{REQUEST_FILENAME}.html [QSA,L]

Add it on the end.

Hope it helps.

z3nth10n
  • 2,341
  • 2
  • 25
  • 49
0

You can just add MultiViews option to make it work by loading correct file after adding extensions internally.

Place this line at top of your .htacces:

Options +MultiViews
anubhava
  • 761,203
  • 64
  • 569
  • 643