Removing .html From Web Address

Messages
419
Name
Dave
Edit My Images
Yes
Hi all, as the title says is there a way to remove the .html at the end of my web address (www.davejay.co.uk/gallery.html) so it just says www.davejay.co.uk/gallery ? Or is there a bit of code I've got to include if i wanted to send people the link so it redirects automatically to /gallery to gallery.html
I'm using Dreamweaver for editing if that helps.
 
Last edited:
/gallery will usually be looking for a folder called gallery, and the default file in that folder (index.html for example).

You can create that folder and use the default file in it as your gallery page, i.e. copy the code from gallery.html into index.html in the gallery folder (although that would mean changing the path to the images in that file as well). Or you could put a redirect into /gallery/index.html to point it towards gallery.html. In that case the page the user viewed would still have .html on the end, but at least the link you distributed wouldn't.
 
/gallery will usually be looking for a folder called gallery, and the default file in that folder (index.html for example).

You can create that folder and use the default file in it as your gallery page, i.e. copy the code from gallery.html into index.html in the gallery folder (although that would mean changing the path to the images in that file as well). Or you could put a redirect into /gallery/index.html to point it towards gallery.html. In that case the page the user viewed would still have .html on the end, but at least the link you distributed wouldn't.

:agree:

Also you could use a htaccess Mod rewrite so that when Gallery/ will go to Gallery/index.html to htaccess Mod rewrite it to point to gallery.html
 
Last edited:
:agree:

Also you could use a htaccess Mod rewrite so that when Gallery/ will go to Gallery/index.html to htaccess Mod rewrite it to point to gallery.html

I was reading a page about doing that but it seems being on a Mac I can't view htaccess files

I tried the redirect, but the only code I can find includes the .html
 
This is very simple to do - create a folder called 'gallery' - open your gallery.html file and re-save it as index.html in the gallery folder - allowing all the links to be updated. Using Dreamweaver this would take a couple of seconds.
 
This is very simple to do - create a folder called 'gallery' - open your gallery.html file and re-save it as index.html in the gallery folder - allowing all the links to be updated. Using Dreamweaver this would take a couple of seconds.

thats basically what Rob and I said :thumbs:
 
It was - however if you use Dreamweaver and do a 'save as' it offers the option of updating all the links for you - making it a breeze. :)
 
This is very simple to do - create a folder called 'gallery' - open your gallery.html file and re-save it as index.html in the gallery folder - allowing all the links to be updated. Using Dreamweaver this would take a couple of seconds.

So when I upload them to the server what do I do with the original files?
 
To be neat and tidy you'd remove gallery.html in the original folder. I bet most would just leave it there though...

One thing you'd need to remember to do is that any links pointing to the old gallery.html from other pages would need updating to point to the new location.
 
Back
Top