Jackd Posted August 31, 2009 Posted August 31, 2009 Hey Two questions, how can i match a url with a dot in it, currently im using a line like this, RewriteRule ^music/([^/\.]+)/images/?$ artist/images.php?artist=$1 but when there's an artist such as Run D.M.C. it doesn't work, and i dont know enough about regular expressions to know how to fix it I've also got a url which should be something like /music/ARTIST/ALBUM/ so how can i make this work while also keeping the /music/ARTIST/images/ working? Thanks Jack
contink Posted September 1, 2009 Posted September 1, 2009 Two questions, how can i match a url with a dot in it, currently im using a line like this, RewriteRule ^music/([^/\.]+)/images/?$ artist/images.php?artist=$1 but when there's an artist such as Run D.M.C. it doesn't work, and i dont know enough about regular expressions to know how to fix it ^music/([A-Za-z0-9_\-]+[A-Za-z0-9_\-/\.]+)/images/(.)*$ That matches a single character WITHOUT a dot in it before it matches the rest of the artists name (to avoid someone trying a ../ style redirect) and should work... Probably not efficient though. I've also got a url which should be something like /music/ARTIST/ALBUM/so how can i make this work while also keeping the /music/ARTIST/images/ working? Given that you will probably find an album called "images" I think that's a mission impossible.. I'd reorganise that IMHO.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now