Jump to content

Recommended Posts

Posted

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 :p

 

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

Posted
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 :p

^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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...