-2

I have a website with 000webhost, and I was wondering how I can get a url like this: Website.com/ITCMDN to forward to Website.com/ITCMDN.html Like I don't want people to have to type in the .html part, and I know this must be possible. Should I put something in my Index.html? Thanks!

Mark Deven
  • 550
  • 1
  • 9
  • 21

1 Answers1

1

Try placing this in your .htaccess file:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ /$1 [L,R=301] 
The Codesee
  • 3,714
  • 5
  • 38
  • 78
  • gives me error 404, and even though ITCMDN.Html exists, its now not letting me open that either (www.Website.com/ITCMDN.html) – Mark Deven Dec 18 '17 at 12:28
  • 1
    @MarkDodsons Apologies. Please try taking a look at https://stackoverflow.com/questions/5730092/how-to-remove-html-from-url for other answers – The Codesee Dec 18 '17 at 16:01
  • I figured it out here: https://www.000webhost.com/forum/t/remove-html-extension-not-working/101235 – Mark Deven Dec 26 '17 at 16:13