shawn2page Posted October 19, 2006 Share Posted October 19, 2006 I need to get this code to do more:RewriteRule ^([A-Za-z]+)$ profile.php?ID=$1It now works so if they type www.mysite.com/johndoe it will take them to johndoe's page on our site. But the problem I have is if a member signs up with member name mark2000 the code will not work. How can i set it up to work with numbers or symbols? Link to comment https://forums.phpfreaks.com/topic/24397-wwwmysitecomjohndoe-rewrite/ Share on other sites More sharing options...
wildteen88 Posted October 20, 2006 Share Posted October 20, 2006 Add 0-9 after A-Za-z in the rewriteruleSo its like this:[code]RewriteRule ^([A-Za-z0-9]+)$ profile.php?ID=$1[/code] Link to comment https://forums.phpfreaks.com/topic/24397-wwwmysitecomjohndoe-rewrite/#findComment-111940 Share on other sites More sharing options...
shawn2page Posted October 21, 2006 Author Share Posted October 21, 2006 that works great! but can I get it to work with say www.mysite.com/john_moore or other charaters?if so what would the code be Link to comment https://forums.phpfreaks.com/topic/24397-wwwmysitecomjohndoe-rewrite/#findComment-112419 Share on other sites More sharing options...
wildteen88 Posted October 24, 2006 Share Posted October 24, 2006 Add '-_' (without the quotes) after 0-9 in the square bracketsif you get a 500 error after doing that change, then you might need to use '\-_' instead. Link to comment https://forums.phpfreaks.com/topic/24397-wwwmysitecomjohndoe-rewrite/#findComment-113719 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.