47 posts
  • 6 Years of Membership
  • Collector Level 3
  • 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.

5492 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Australia
  • Author Level 3
+5 more
Australia
says

you could use .htaccess to do rewrites also

47 posts
  • 6 Years of Membership
  • Collector Level 3
  • 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]

1832 posts
  • Beta Tester
  • Trendsetter
  • United States
  • Copyright Ninja
+6 more
plugindistrict
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!

65 posts
  • 4 Years of Membership
  • Affiliate Level 2
  • Author Level 5
  • Beta Tester
+5 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.

1096 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 2
+5 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).

65 posts
  • 4 Years of Membership
  • Affiliate Level 2
  • Author Level 5
  • Beta Tester
+5 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
  • 1 Year of Membership
  • 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