Mobile app version of vmapp.org
Login or Join
Samaraweera270

: Link to pages on site without .html extension appearing in browser? I've modified my .htaccess file to allow access to html files without having to include the extension on the end, for example:

@Samaraweera270

Posted in: #Htaccess #ModRewrite #Redirects #Url

I've modified my .htaccess file to allow access to html files without having to include the extension on the end, for example:
mysite.com/document

directs to
mysite.com/document.html
However, when I want to link to pages within my site using something like <a href="page.html"></a> I still get the .html appearing in the URL.

So am I allowed to exclude the extension and leave a link as <a href="page"></a> so that the extension doesn't appear in the browser? Or is there a better way to do it?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Samaraweera270

1 Comments

Sorted by latest first Latest Oldest Best

 

@Gretchen104

Yes, make your links match your URLs.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme