I've had a first look at using the mod_rewrite MOD to produce the perfect Search Engine URL.
Given my limited knowledge of the Apache mod_rewrite function, two options appear to be available:
- use the php file name in the URL
- enter all of the URLs in the htaccess file
For an example of the first, the URL could be
For the second option. it could be either:HTML Code:http://www.indexuhelp.com/indexu32e/browse-business_to_business-1.html
A word about the dash and underscore in the name used in the URL. In general, to display a page you need 3 bits of information:HTML Code:http://www.indexuhelp.com/indexu32e/business_to_business.html or http://www.indexuhelp.com/indexu32e/business_to_business-1.html
- the PHP file used to generate the page, e.g., browse.php
- which category to display
- which page of a multi-part listing to display
A regular php url would look lilke
Your browser would read this as: use the browse.php file to display page 5 of the category #2 listing.HTML Code:http://www.indexuhelp.com/indexu32e/browse.php?cat=2&pgwhich=5
Well, the mod-rewrite function still needs the same information. That is why you see
The mod_write separates the information based on the dashes:HTML Code:http://www.indexuhelp.com/indexu32e/browse-business_to_business-5.html
- browse- tells the mod-write function to use the browse.php file ( and not any other file like the detail.php file )
- -business_to_business- tells the mod-write function to display the business_to_business category
- and the -5 says to display page 5 of the business_to_business category
I said all of that to illustrate this point. If I now use dashes in the category name, I end up with
and the mod_rewrite interprets the dashes in business-to-business as "bits" of information and becomes confused.HTML Code:http://www.indexuhelp.com/indexu32e/browse-business-to-business-5.html
Unless, I can find a way around that, I must use something other than dashes within the category name. Thus, the use of underscores.
If you have a small number categories, you could just enter them in the htaccess file. But there is a "time" penalty assocciated with loading that file and another "time penalty" to read the contents of the file.
Just some first thoughts.
.


LinkBack URL
About LinkBacks
I'm sure it won't look anything like his. at least the code that is. but the effects would be the same.
