Mesh3L 0 Posted April 14, 2011 Report Share Posted April 14, 2011 Hello,I'm a mod_rewrite newbie. I want to do the following :If a user visits www.mysite.com/ (numbers only)to be forwarded to : www.mysite.com/test.php?number= ( what ever the user entered above )But, if anything other than numbers is entered it doesn't forward to that page. Instead it takes them to www.mysite.comAnd if a user visits an existing page, nothing should be done (e.x www.mysite.com/example.php)Thank you Quote Link to post Share on other sites
Fmdpa 9 Posted April 15, 2011 Report Share Posted April 15, 2011 RewriteRule ^([0-9]+?)$ "test.php?number=$1" [R] Quote Link to post Share on other sites
Mesh3L 0 Posted April 15, 2011 Author Report Share Posted April 15, 2011 (edited) RewriteRule ^([0-9]+?)$ "test.php?number=$1" [R] This is perfect! Thanks Edited April 15, 2011 by Mesh3L Quote Link to post Share on other sites
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.