bander Posted August 23, 2006 Share Posted August 23, 2006 Hallo,Want to use RewriteRules for SEO friendly URLs, but I need a little bit help with it. I exactly know what end result I want but how to do it is something else;)It's about the following (ugly) URLwww.domain.com/?lang=tr&path=products/telephone/mobiel/samsung&item=1 (or with end slash in URL)to make it better readable for you:www.domain.com/ ?lang=tr& path=products/telephone/mobiel/samsung & item=1 (or with end slash in URL)With a RewriteRule I should have the following URL:www.domain.com/tr/products/telephone/mobiel/samsung/1 (or with end slash in URL)In PHP I should catch the following $_GET's$_GET['lang'] value stored: "tr"$_GET['path'] value stored: "products/telephone/mobiel/samsung"$_GET['item'] value stored: "1"A condition is that the parameterlength behind the &path.... is dynamic generated, so this can be 0 to more.The following example (Bold) obliges that 4 parameter is given in order to rewriteRewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/ /?lang=$1&[b]path=$2/$3/$4/$5[/b]&item=$6Can anybody help me with a practical example? I thank you. Link to comment https://forums.phpfreaks.com/topic/18395-rewriterule-regex-beginners-question/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.