Creating 123456789.html instead of page.php?page=123456789

I have been told that search engines are less eager to look a web pages that have a field param at the end, then a standard html.

I notice on this site for examle, a question, eg:

the Question Number is in the "filename" with the extension of html.

At present I am using a database driven information pages, (ease of editing for clients) that all use the format, eg:

How is this done?
Who is Participating?
ERNesbittConnect With a Mentor Commented:
RewriteRule ^([A-Za-z0-9]+).html$ /page.php?page=$1

will get all alpha and numeric values...

babuno5Connect With a Mentor Commented:
well you need to rewrite your urls
check this tutorial out
tolgaongConnect With a Mentor Commented:
#LoadModule rewrite_module modules/
LoadModule rewrite_module modules/

.htaccess file
RewriteEngine On
RewriteRule ^([0-9]+).html$ /page.php?page=$1  

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

amakaramAuthor Commented:
That sounds easy enough, but making the change to the http.conf file would make this server wide.

Before I make this change:

1. if there was nothing in other sites .htaccess file then this change would not affect them, correct?

2. I actually use "md5(uniqid(rand(), true));" to create some of my extensions, so I would need the rewrite rule to be alpha-numeric.

3. This would work great for Individual page, but some are multiples, section, then subsection... eg:
Individual page:
Section Page:
Subsection Page:  

a) would this change a subsection page to be:
     .../ct_20060729065611.htm?DP=262a6...66c7a ?

b) could this rewrite be changed to make a page on its own (removing query pages all together)  Not sure if having the length of .../ct_20060729065611_262a61d5bbefd9305f5979a41f766c7a.htm is a great idea.

If this can be done for a subsection, I could see future sites being created, not using a 32 character code... 10 characters each is really more then enough, that way it would fit under the 33 character limit for macs (or is this limit just a myth?).

Your thoughts?

Thanks in advance.
amakaramAuthor Commented:

I can make the sites point to one page.

Instead of having the two querys, I can make it only have one, so just one question.

Making "RewriteRule ^([0-9]+).html$ /page.php?page=$1 " for more then just numerica values.


I think this would =


amakaramAuthor Commented:
The actual code does not seem to change any page "a href's".

For Example: ".../page.php?page=abc123", it stays the same in the top menu bar. I guess thats ok for now.

When you click on a link, it does not change it to read as an html doc, but the example above still appears.

The opposite access works.  (eg. .../abc123.html) does pull up the correct page, but that only works until you click on a link.

Is there a way to update the "a href" links inside the page as well, as this (experts-exchange) site does?

amakaramAuthor Commented:
Hum, I think I should ease off the cold medication!  :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.