Forum Moderators: phranque
I'm attempting to mix clean url's with query strings. This is for an online shopping catalogue.
The shopper is able to browse different categories of the store. Within each category page, there can be hundreds of items, so there is a need to have multiple pages and also to be able to sort the pages by price, or by name, etc.
What i'm trying to accomplish is to get a URL similar to what Etsy has on their site:
[etsy.com...]
They have the clean url for "category/books_and_zines" but then they strip the .php and have the query string following ?order=date_desc&page=3
Basically I just want to have the $_GET query string be able to append onto the end of the clean url. Does anyone know of the rewrite rules to achieve this?
Right now I have this working:
RewriteRule ^category/([A-Za-z0-9-_]+)$ view_category.php?category=$1
outputs:
/category/monitors_lcd
Please let me know if you need more information from me as I'm fairly new to this stuff.
Thanks again to anyone who is able to shed some light on this.
All that was necessary was adding [QSA] at the end of my rewriteRule as so:
RewriteRule ^category/([A-Za-z0-9-_]+)$ view_category.php?category=$1 [QSA]
Thanks to ChadSEO and j_a_c_k for their previous post found here: [webmasterworld.com ]
When deciding what info to move from the query string into a "clean" or "SEO-friendly" URL, consider what is useful in public search results, and what is not: Category and product pages are generally useful, while on-site search sort key, sort order, page counts, purchase quantities, and other searching/buying-related parameters are not worthy of an additional public search engine listing. So a URL of exampe.com/shop/category/product-type/product-color/product-size/specific-item?quantity=3 is a pretty good set-up.
[added] See our Apache Forum Charter for links to some useful resources. [/added]
Jim
[edited by: jdMorgan at 12:01 am (utc) on May 6, 2009]
In fact in much prefer a single ID for a product page: example.com/item9372261617
The database can hold the data as to what category indexes, colour indexes, size indexes, brand indexes, and offer indexes it can appear in - without reflecting any of that stuff out into the URL.