doddsey_65 Posted June 11, 2010 Share Posted June 11, 2010 I am trying to use a htaccess file to rewrite my urls to be SEO friendly. eg instead of profile.php?username=username it would be profile/username/username.html this is the contents of my htaccess: Options +FollowSymLinks RewriteEngine on RewriteRule profile/usrename/(.*)/ profile.php?usrename=$1 unfortunatly its not working. My host does have this enabled and it is in my site root. Is there anything i have forgot to include for it to work? Quote Link to comment https://forums.phpfreaks.com/topic/204525-htaccess/ Share on other sites More sharing options...
jcbones Posted June 12, 2010 Share Posted June 12, 2010 Try: RewriteRule ^profile/username/(.*).html$ profile.php?username=$1 Or, RewriteRule ^profile/(.*)/(.*).html$ profile.php?$1=$2 Quote Link to comment https://forums.phpfreaks.com/topic/204525-htaccess/#findComment-1070985 Share on other sites More sharing options...
doddsey_65 Posted June 12, 2010 Author Share Posted June 12, 2010 nope neither of them worked either. just to make sure im putting it in the right place the .htaccess file is in the same directory as the main index.php page. Quote Link to comment https://forums.phpfreaks.com/topic/204525-htaccess/#findComment-1071003 Share on other sites More sharing options...
cags Posted June 12, 2010 Share Posted June 12, 2010 RewriteRule ^profile/username/([^/]*)\.html$ /profile.php?username=$1 Quote Link to comment https://forums.phpfreaks.com/topic/204525-htaccess/#findComment-1071081 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.