Removing the index.html from url -


ok, maybe pretty dumb question can't find answer on google.

i coding site hand. how make index.html disappear url's? use piece of code in html? have change href's in files?

hope guys can help!

edit: i've tried .htaccess file

rewriteengine on rewriterule ^index\.html$ / [r=301,l] rewriterule ^(.*)/index\.html$ /$1/ [r=301,l]

it work, links aren't working anymore. discovered had remove index.html href's in documents. lot of work. there other code .htaccess hides index.html?

a simple way in html:

(example in case simple dual language site)

if link looks this:

<a href="index.html">homepage</a> 

you should change this:

<a href="/">homepage</a> 

if trying link folder in directory, example:

<a href="en/index.html">english language</a> 

you should change this:

<a href="en">english language</a> 

notice "/" goes root directory , automatically selects index.html, why used "en" english language site, because name of folder in case "en". should make sure have index.html in english language folder, , not index-en.html.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -