MDanz Posted August 2, 2011 Share Posted August 2, 2011 i've done this RewriteRule ^([A-Za-z0-9-]+)/?$ profile.php?user=$1 [L] to make www.example.com/profile.php?user=testing into www.example.com/testing What i'd like to do is change.. www.example.com/profile.php?user=testing into www.example.com/user=testing What is the RewriteRule to accomplish this? Also if i used $_GET['user'] with the second clean url would it still work? Link to comment https://forums.phpfreaks.com/topic/243577-help-with-mod_rewrite/ Share on other sites More sharing options...
trq Posted August 2, 2011 Share Posted August 2, 2011 What is the RewriteRule to accomplish this? RewriteRule ^user=([A-Za-z0-9-]+)/?$ profile.php?user=$1 [L] Also if i used $_GET['user'] with the second clean url would it still work? Yes, because you are still actually receiving a request to profile.php?user=testing as if the rewrite doesn't exist. Link to comment https://forums.phpfreaks.com/topic/243577-help-with-mod_rewrite/#findComment-1250616 Share on other sites More sharing options...
MDanz Posted August 2, 2011 Author Share Posted August 2, 2011 thanks i changed it and it works.. but now it my CSS isn't working? it just has the text on a white page. How do i fix this? Link to comment https://forums.phpfreaks.com/topic/243577-help-with-mod_rewrite/#findComment-1250661 Share on other sites More sharing options...
MDanz Posted August 2, 2011 Author Share Posted August 2, 2011 nvm i know how to resolve it. Link to comment https://forums.phpfreaks.com/topic/243577-help-with-mod_rewrite/#findComment-1250667 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.