Hi all
I just need a quick recap on what I need to do. I have a DB showing files as pages based on the website:
/section
/section/category1
/section/category2
I want to add .html to the end of every category:
/section
/section/category1.html
/section/category2.html
section = section.php, I already have a htaccess set up, just wondering how I add the .html to the above?
Thanks 
Why would you want to? That would make it harder for the end user to type, force the search engines to need to re-index everything (meaning 404 errors everywhere for a while!) and it undermines the reason why friendly URL’s were invented… to make the website address less intimidating to regular people.
Thanks Alex
Why would you want to?
Mainly because of a google video I watched and Matt Curtis recommend you always have a .html or some other extension, so google can understand your page quicker, also stops people from adding stuff at the end (SQL attacks) in case I ever forget to escape my code.
search engines to need to re-index everything
These are new pages so there want be any 404 as everything is new waiting to get indexed.
I do prefer cleaner url’s myself and still use them, it’s just the video clearly outlined:
section - is ok because of a directory level
section/category - is ok but
section/category.html - is better
Both still work, but just wondering how I could add it? And is it worth it? After watching the video I thought maybe hes right?
Thanks 
I disagree with what he’s said. If the content is submitted in the normal manner (such as through a sitemap) there shouldn’t be much difference in how long it takes to appear in search engines. More to the point, the cost in accessibility and usability in adding the file extensions far outweighs any slight benefit in indexing speed you may get. True there may be the un-escaping issue (I haven’t had any issues in that respect so I can’t comment on it) however there was a very good reason why friendly URL’s were invented, it seems rather silly to reverse the practice on the basis of some strange advice given by Matt. 
Yes cheers Alex, just how I was thinking… just needed a second opinion I’ll just stick with what I have.
(I haven’t had any issues in that respect so I can’t comment on it)
A hope I don’t run into any issues either, just have to remember to double check my code before going live, thanks again 
out of curiosity,(if you have time) how would I add .html to the end anyway?
my rewrite(anything to do we this?)
RewriteRule ^/?venues/([-a-z_]+)$ venues.php?category=$1 [L]
Hi Computerbarry,
I’d try something like this:
RewriteEngine on
RewriteRule ^/?([a-z/]+)\\.php$ $1.html [L]
Of course you’d need to change it to your requirements.
Oh no no, rewrites go from what people typed in or clicked to what the actual file is.
If the actual file isn’t blahblah.html then you can’t rewrite blahblah to blahblah.html.
If your file is saved as blahblah.html then it’s automatically .html in the filesystem so I’m terribly confused how you have real HTML files without the actual .html/.htm extension on the things. Normally something like what you posted above
section/category
means “category” is a directory, not a file. People use mod_rewrite to make files look like directories because they want to remove the .html extension… but if it’s really already that way then I’m seriously confused how that happened. You really have text documents called “category” (as an example)? If so, why not just rename the files “category.html”?
Otherwise, if you really somehow do have files called “category” and want them to look like “category.html” then you do this:
first, change all your links on your page to reflect the new name you want
<a href=“category.html”>Categroy</a>
then, set your mod_rewrite opposite of kohoutek’s:
RewriteEngine on
RewriteRule ^/?([a-z/]+)\\.html$ $1 [L]
Which says, match blah.html and send it to the matched “blah” (again, it’s really weird to have a file called “blah” on the server… so weird that pretty much everyone in the world is doing it the other way around… they have blah.html and want it to look like “blah”).
Most likely, I’m completely misunderstanding the whole thing… in which case, disregard everything above : )
Ooh, prolly before creating that rewrite rule, there should be a RewriteCond that first checks if the thing we’re matching is a file and not a directory:
RewriteCond %{REQUEST_FILENAME} !-d
Though then this is starting to get into the Apache Forum’s area of expertise…
Something sounds wrong with that advice. I have pages that end with “.php” but Google doesn’t read them as PHP files, they read them as XHTML pages. Why’s that? Because that’s what the HTTP headers and DOCTYPE specify.
The same for my blog’s friendly URLs. Sounds like bosh to me. - As long as your HTTP headers and DOCTYPE are OK. I can’t see where they’d go by an extension instead.