php ct.script cript
mo mod_rewrite
_The Internet
Internet vi visitor itor
mo mod.rewrite tran .translate lates the req request to
t http://www.example.com/pro produ duct.php ct.php?pro produ duct_i ct_id=3 =36
pro produ duct.php exec ct.execute tes an and generate enerates outp tput
CHAPTER 7 ?– SEARCH ENGINE OPTIMIZATION 191
In this chapter, we??™ll implement the support for the URLs types listed in Table 7-1. In each
case, ???X??? is used as placeholder for department, category, product IDs, and ???P??? is a page number.
Table 7-1. URL Formats Supported by TShirtShop
URL Type URL Format
Front page URL http://www.example.com/
Front page URL if paginated http://www.example.com/page-P/
Department URL http://www.example.com/department-name-dX/
Department URL if paginated http://www.example.com/department-name-dX/page-P/
Category URL http://www.example.com/dept-name-dX/cat-name-cX/
Category URL if paginated http://www.example.com/dept-name-dX/cat-name-cX/page-P/
Product URL http://www.example.com/product-name-pX/
There are more details you need to learn to fully support such URLs, but we??™re taking things
one at a time. Follow the exercise to implement support for keyword-rich URLs, and we??™ll discuss
the details afterward.
Exercise: Supporting Keyword-Rich URLs
1. The first step is to make sure that mod_rewrite is enabled on your Apache installation.
Pages:
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297