Im trying to create a custom image galleri that retrieves images from posts as can be seen here
http://kurdaktuellt.se/galleri/
problem in hand is that I'm trying to make the url somewhat user friendly and I've searched the internet for an answer and the closest thing I've come up with is
add_action( 'init', 'wpse12065_init' );
function wpse12065_init()
{
global $wp;
$wp->add_query_var('images');
add_rewrite_rule(
'^galleri/images/([^/]*)/?',
'index.php?pagename=galleri&images=$matches[1]',
'top'
);
}
This url works just fine
http://kurdaktuellt.se/?pagename=galleri&images=1452
but this one
http://kurdaktuellt.se/galleri/images/1598/
shows nothing
Any help is very much appreciated Regards

http://kurdaktuellt.se/galleri/images/1598/I got a page not found, now i just get to thehttp://kurdaktuellt.se/galleri/– Breezer Oct 3 '12 at 5:04var_dumpthe$wp_queryglobal and verify that it exists. have you flushed rules since adding the query var? you'd get a 404 if the rewrite hasn't been picked up, but the fact that the rewrite doesn't 404 suggests the issue is elsewhere in your theme. – Milo Oct 3 '12 at 15:06get_query_var('images')working which is not... – Breezer Oct 3 '12 at 16:00echo get_query_var('images')outputs the correct value, your issue is not with the above bit of code you've posted. – Milo Oct 3 '12 at 16:07