chantown Posted December 6, 2007 Share Posted December 6, 2007 I've been trying to learn Regular Expression, but just don't get it If I want to redirect www.istage6.com/index.php?code=12345 to www.istage6.com/12345, how do I do that in htaccess? RewriteEngine On RewriteRule ^([^-]*)$ /index.php?username=$1 [L] That doesn't work! Quote Link to comment https://forums.phpfreaks.com/topic/80528-can-someone-help-me-with-this-simple-mod-rewrite-please/ Share on other sites More sharing options...
trq Posted December 6, 2007 Share Posted December 6, 2007 I've been trying to learn Regular Expression, but just don't get it If I want to redirect www.istage6.com/index.php?code=12345 to www.istage6.com/12345, how do I do that in htaccess? RewriteEngine On RewriteRule ^([^-]*)$ /index.php?username=$1 [L] That doesn't work! Of course it doesn't. Try... RewriteEngine On RewriteRule ^/([0-9])$ /index.php?code=$1 [L] Quote Link to comment https://forums.phpfreaks.com/topic/80528-can-someone-help-me-with-this-simple-mod-rewrite-please/#findComment-408338 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.