Mesh3L Posted April 14, 2011 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 Link to comment Share on other sites More sharing options...
Fmdpa Posted April 15, 2011 Share Posted April 15, 2011 RewriteRule ^([0-9]+?)$ "test.php?number=$1" [R] Link to comment Share on other sites More sharing options...
Mesh3L Posted April 15, 2011 Author Share Posted April 15, 2011 RewriteRule ^([0-9]+?)$ "test.php?number=$1" [R] This is perfect! Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.