41 posts
  • Bought between 10 and 49 items
  • Has been a member for 5-6 years
  • 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.

5385 posts
  • Australia
  • Bought between 100 and 499 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Interviewed on the Envato Notes blog
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
Australia says

you could use .htaccess to do rewrites also

41 posts
  • Bought between 10 and 49 items
  • Has been a member for 5-6 years
  • 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]

1401 posts
  • Author had a File in a Mini Bundle
  • Has been a member for 4-5 years
  • Sold between 1 000 and 5 000 dollars
  • Exclusive Author
  • Bought between 50 and 99 items
  • Referred between 10 and 49 users
  • United States
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!

62 posts
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
  • United Kingdom
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.

504 posts
  • Bought between 10 and 49 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • United Kingdom
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).

62 posts
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
  • United Kingdom
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
  • Has been a member for 0-1 years
  • 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