php_begins Posted November 21, 2011 Share Posted November 21, 2011 I have pagination code in members page that has pages 1,2,3 and so on. /member_test.php?pn=1 where pn can be 1,2,3 etc. I need to redirect the above page such that it redirects to /test/1 , test/2 and so on.. I have the following rule which works perfectly fine in the browser. RewriteRule ^/member_test.php?pn=(.*) /test/$1 [PT] But the content of the above redirect is always page 1. i.e it always dispays the content of member_test.php?pn=1.. /test/1 ,test/2, test/3 always displays the content of 1. Can you help me with the current redirect rule.. Quote Link to comment Share on other sites More sharing options...
requinix Posted November 21, 2011 Share Posted November 21, 2011 I have the following rule which works perfectly fine in the browser. RewriteRule ^/member_test.php?pn=(.*) /test/$1 [PT] But the content of the above redirect is always page 1. i.e it always dispays the content of member_test.php?pn=1.. So it's not perfectly fine... First, are you talking about redirecting from member_test.php to /test? Because I think you aren't. I think you mean I want people to go to /test/N and pretend as if they actually went to /member_test.php?pn=N In that case you have your RewriteRule terms backwards: RewriteRule old_url new_url Quote Link to comment Share on other sites More sharing options...
php_begins Posted November 21, 2011 Author Share Posted November 21, 2011 i didnt explain it properly. When people click on member_test.php?pn=2 (the link would point to /test/2 in my php code) it would take them to member_test.php?pn=2, but in the URL it would show /test/2. So for them it would look like they are in test/2, but in reality it would show the page produced by member_test.php?pn=2 Quote Link to comment Share on other sites More sharing options...
requinix Posted November 21, 2011 Share Posted November 21, 2011 Right. That's not quite what you said but it is what I thought you meant. 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.