Deek Deek - 5 months ago 30
Apache Configuration Question

Mod rewrite breaks using name

I have this in my .htaccess file

RewriteRule ^member/([^/][0-9]*)$ profile.php?id=$1

and it works as it should what I am trying to do is instead of id I want to use name. so I changed my link accordingly and tried

RewriteRule ^member/([^/][0-9]*)$ profile.php?name=$1

and I get page cannot be found I am retrieving the name and ID together.

username may have characters in it

Answer Source
RewriteRule ^member/([^\/\?\#]+) profile.php?name=$1

This should do the trick.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download