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

General Discussion

Christopher Montolio
Christopher Montolio
794 Points

HELP: How can I get rid of my url extensions

I am using Dreamweaver CS6. I have my website up and running but the only problem is my pages have extensions at the end of them.

For Example

www.example.com/about.html

www.example.com/menu.html

www.example.com/contact.php

How can I make it to where it looks like this

www.example.com/about

www.example.com/menu

www.example.com/contact

Is this something you can do in Dreamweaver?

Many Thanks!

1 Answer

Kevin Korte
Kevin Korte
28,148 Points

It's pretty easy to do, but it has nothing to do with dreamweaver.

In your root directory, you will need to make sub folders such as menu, about, and contact.

Than, take your about.html and rename it index.html. Take your menu.html and rename it index.html, and take your contact.php and rename it index.php. You want to put each of these new index files into the correct subfolder, so it would probably be smart to do them one at a time.

Now make sure you have updated all of your links, because most likely you will have broken links!

Why does the work? Browsers will look for the index file automatically! Thats is why your home page is www.example.com; you don't need to give the browser www.example.com/index.html even though that would also be correct.

Randy actually does just this in a chapter of his PHP application.

If you're confused, you can (and I would suggest) at least watching that chapter found here:

http://teamtreehouse.com/library/programming/enhancing-a-simple-php-application/cleaning-urls-with-subfolders

Christopher Montolio
Christopher Montolio
794 Points

Great! Thank you so much Kevin! I'll def try it out

Kevin Korte
Kevin Korte
28,148 Points

No problem Chris! What you want to do is certainly worth doing, and it should be fairly easy. Good luck