.htaccess - URL Rewriting in Wordpress htaccess -
i've built wordpress site has product page retrieves product info external system using querystring id passed in. www.domain.com/product/?id=n loads wordpress product page loads product info using id.
this works fine.
however, want rewrite url that:
www.domain.com/product/productname/id retrieves www.domain.com/product/?id=n
when add following htaccess, page returns 404 because doesn't exist in wordpress.
rewriterule ^product/productname/(.*)$ ^product/?id=$1 [l]
does know how write rule in such way doesn't hijacked wordpress rewriting?
after doing additional searching, i've found links may started. secret lies in wordpress's add_rewrite_rules
hook. haven't tried these myself yet, looks promising:
Comments
Post a Comment