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? Quote 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. Quote 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? Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/243577-help-with-mod_rewrite/#findComment-1250667 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.