我已閱讀過「slugs」,但我仍然無法弄清楚如何使用它們。如何正確保存數據庫中的slu?聲?在php中的seo url`s
可以說我有網址類似這樣的http:/example.com/samsung/samsung_continuum_android_smartphone/
這是我做的
select category_id from categories where category_name = 'samsung'
在那之後我也喜歡查詢
select slugs from my_table where category_id = (lets say 3 where is samsung)
結果類似於 samsung_continuum_android_smartphone samsung_some_other_phone。
在那之後我可以做這樣的事情
select * from info where title = 'samsung_continuum_android_smartphone'
,以獲取有關產品的信息。這是做到這一點的正確方法嗎?
請看相關主題 – Kemo 2011-04-18 19:29:37
可能出現的重複[使用PHP的SEO友好URL到動態URL](http://stackoverflow.com/questions/2915304/seo-friendly-url-to-dynamic-url-using-php ) – 2011-04-18 19:30:56
@Marc BI認爲我的問題與您建議的鏈接無關 – Zaharev 2011-04-18 19:37:32