Solved

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

Posted on 2006-10-20
7
319 Views
Last Modified: 2006-11-18
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:

http://www.experts-exchange.com/Web/Q_21932114.html

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:

www.thissite.com/page.php?page=PAGEID#

How is this done?
0
Comment
Question by:amakaram
7 Comments
 
LVL 15

Assisted Solution

by:babuno5
babuno5 earned 300 total points
ID: 17778637
well you need to rewrite your urls
check this tutorial out
http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html
0
 
LVL 9

Assisted Solution

by:tolgaong
tolgaong earned 50 total points
ID: 17780514
http.conf
#LoadModule rewrite_module modules/mod_rewrite.so
to
LoadModule rewrite_module modules/mod_rewrite.so

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

0
 

Author Comment

by:amakaram
ID: 17790176
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:
     .../page.php?D=3be7b7fbaf1bbd1e8c6c8d1c85e85d6b
Section Page:
     .../page.php?D=ct_20060729065611
Subsection Page:  
     .../page.php?D=ct_20060729065611&DP=262a61d5bbefd9305f5979a41f766c7a

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.
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:amakaram
ID: 17836271
Ok,

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.

eg

...website.com/page.php?D=ABCabc123

I think this would = ...website.com/ABCabc123.html

Thanks.

0
 
LVL 3

Accepted Solution

by:
ERNesbitt earned 150 total points
ID: 17837104
RewriteRule ^([A-Za-z0-9]+).html$ /page.php?page=$1

will get all alpha and numeric values...

ERNesbitt
0
 

Author Comment

by:amakaram
ID: 17903081
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?

Thanks!
0
 

Author Comment

by:amakaram
ID: 17903643
Hum, I think I should ease off the cold medication!  :)
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP & MySql - Turn Select Query Results into a Glyphicon 3 28
php checkbox validation 5 27
error log using ftp 7 37
how to use a switch statement with heredoc 11 17
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now