42 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Located in United States
cmF says

So I’m creating an HTML only site for first time years. Usually, I have a CMS to work with that makes URLs nice and pretty but what if I want to have /contact instead of contact.html?

Do I just put an index.html in every folder?

index.html contact/index.html about/index.html services/index.html

Or is there a super light CMS type service I can use? I don’t need WYSIWYG editors, but just something with a little more muscle than a plain html site, but not a full CMS. Any help would be much appreciated. Thanks.

5461 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
  • Has sold $1,000+ on Envato Market
+4 more
Australia says

you could use .htaccess to do rewrites also

42 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Located in United States
cmF says

you could use .htaccess to do rewrites also

Thanks! Searched it up and found a stackoverflow solution that will work perfectly for me.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ /$1 [L,R=301]

1420 posts
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Had an item featured in an Envato Pack
+3 more
WebSmacker says

There are a few lightweight CMS scripts that will work for you. I like this one:

http://codecanyon.net/item/cms-pro-m2-content-management-system/140078

EDIT: just saw that Steve answered first – glad you got what you are needing!

64 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+4 more
WebDesignPlanet says

I encountered this problem recently and decided to create several directories and put index.html files in each of them. I am not sure how this affects search engine bots though. I use www.url.com/about/ structure in all my links throughout the site, but in fact it is www.url.com/about/index.html. I wonder if bots just follow the links in form they were created.

560 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
Gareth_Gillman says

I encountered this problem recently and decided to create several directories and put index.html files in each of them. I am not sure how this affects search engine bots though. I use www.url.com/about/ structure in all my links throughout the site, but in fact it is www.url.com/about/index.html. I wonder if bots just follow the links in form they were created.

you need to 301 redirect the index.html’s to the relevant page e.g. /contact/index.html to /contact

This because you will have 2 pages according to Google (/contact and /contact/index.html).

64 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+4 more
WebDesignPlanet says
I thought i will add a solution i came up with, to hide index.html (or index.php) files from directiories, i.e.

http://domain.com/directory/index.html

becomes

http://domain.com/directory/

Use this code:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.(html?|php)\ HTTP/
RewriteRule ^(([^/]+/)*)index\.(html?|php)$ http://domain.com/$1 [R=301,L]
3 posts
  • Located in United Kingdom
QWebLtd says

If you’re running an Apache server with mod_negotiation (most servers have this as standard), you can get away with just the following as your .htaccess file:

RewriteEngine On

Options +Multiviews

What this does is enable the negotiation module, which takes the visitors request and attempts to map it to various file extensions, effectively meaning you can get to any of your website files without specifying their extension in the url.

by
by
by
by
by
by