Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Anna Tay
2,092 Points.html showing up when linking out
Hi!
I'm creating my own portfolio page, and all of the sudden my pages are showing up as website.com/link.html vs. website.com/link ....hopefully this question makes sense and someone can help me with the issue?
For some background I'm using domain.com to host and am pushing changes through GitHub.
Thank you so much!
1 Answer
Simon Duchaine
14,441 PointsHi Anna,
This is perfectly normal. When you build static site (in HTML) the output in your address bar is showing the extension on your file, as the browser reads a 'file' in a directory of your hosting.
As it is more common to develop dynamic sites (such as Wordpress), you've probably seen often URL without the file extension (commonly known as pretty links). By default, when you have a wordpress site, your pages don't show .html extensions.
One last thing, if your on an APACHE server, there's a HTACCESS rule that exist to 'rewrite' your urls without the extension. The problem with that is that you need to take care of all your href. (don't put the .html at the end). Here,s more info on that: http://stackoverflow.com/questions/2836400/semantic-urls-for-static-html-files-with-htaccess-and-mod-rewrite
Anna Tay
2,092 PointsAnna Tay
2,092 PointsHi Simon,
Thank you for your help.
This is not only when it's on my computer though. I tried on other devices and on my phone. Maybe you can go to my website: annatay.com and see for yourself? I know this issue is kind of hard to describe over a forum. I'd go to the portfolio section which link out to other websites.
Do you know why it was showing without the .html before and now it appears? It was fine up until a week ago.
Thanks again!