As per the answer provided in How to create custom URL routes? I have created the rewrite rule using the same function provided.
add_action( 'init', 'wpse26388_rewrites_init' );
function wpse26388_rewrites_init(){
add_rewrite_rule(
'gallery/([0-9]+)/?$',
'gallery?custom_gallery_id=$1',
'top' );
}
After the flushing of the rules .htaccess file was having the following rule :
RewriteRule ^gallery/([^/]+)/?$ /wordpress/gallery?custom_gallery_id=$1 [QSA,L]
upto this point everything was fine then I tried to make some modifications in the rule like
add_action( 'init', 'wpse26388_rewrites_init' );
function wpse26388_rewrites_init(){
add_rewrite_rule(
'topic/([^/]+)/([^/]+)/gallery/([0-9]+)/?$',
'gallery?custom_gallery_id=$3',
'top' );
}
this doesn't seems to be working at all. can anybody help me over this? thanks in advance.
topicandgalleryexactly? – Milo Oct 17 '12 at 5:42