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! 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] 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
Archived
This topic is now archived and is closed to further replies.