deepson2 Posted December 15, 2009 Share Posted December 15, 2009 I am working on blog related site earlier i have my blog details page with this url mysite/categories/my_world-johnd Where my world is the title and i was appending the username with it so we came to know that "johnd" is the registered user for the blog "my world" Now we have many anonymous blogs on our site. mysite/categories1/my_life i want user could claim on it. and then redirect those url to the old one. so the new url would be like this mysite/categories/my_life-geetap where geetap is the username and its her blog now registered on the site. function info(){ global $url; $info1= &NEW abc; // echo $url; $user=explode("-", $url, 2); $urlarr= explode("_", $user[0]); $extrcond=""; $urrcount=count($urlarr); for($i=0;$i<$urrcount;$i++){ $extrcond .="AND b.title like '%".$urlarr[$i]."%'"; } $result = "SELECT b.title, b.id,b.url, u.id,u.username FROM b_details b,user_details u WHERE u.id = b.id AND a.username='".$user[1]."' ".$extrcond); return $info1; } categories.php <?php $url =$_REQUEST['url']; //echo $url; // this url is my url which comes in address bar- mysite/categories/my_worls-jonhd $details = $abc->info(); ?> Can anyone please read this and guide me in the right direction. i am not able to figure it out whether i can do this with only php or i need to change my mod-rewrite as well?? I have put up a thread in Apache HTTP Server sections as well http://www.phpfreaks.com/forums/index.php/topic,280594.0.html please help me. Quote Link to comment Share on other sites More sharing options...
deepson2 Posted December 15, 2009 Author Share Posted December 15, 2009 With putting some condition i am able to get both the links on same page with some condition that So if geetap claims her blog then her new blog url should be mysite/categories/my_world-geetap so i want to redirect old url i.e mysite/categories/my_world to mysite/categories/my_world-geetap Can anyone please tell me how can i do that? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.