htaccess querystring based urls

Posted by praveenmon on Stack Overflow See other posts from Stack Overflow or by praveenmon
Published on 2011-01-01T04:47:13Z Indexed on 2011/01/01 4:54 UTC
Read the original article Hit count: 162

Filed under:
|
|
|

hi guys,

Suppose my website is www.example.com

Earlier the urls of my website was like this www.example.com/php/bookdetails.php?bid=33

Last week i changed the urls of my site to this www.example.com/bookdetails/33

and wrote an htacces like this

RewriteRule ^bookdetails/(.*)$ php/bookSearchResult.php?bid=$1

The problem is that there are some external site using my earlier URL structure (www.example.com/php/bookdetails.php?bid=33) and what i want is to redirect it to my new URL structure (www.example.com/bookdetails/33).

I know it can be possible in htaccess, but i have no idea how to do it

© Stack Overflow or respective owner

Related posts about php

Related posts about .htaccess