php - Troubles Overwritting Wordpress Url Rewrites -
so right have plugin enabled allow me use php in pages. i've setup page , set permalink homepage. doing i'm able make requests like
http://mysite.com/?profile=rihanna
and php code execute based on given artist.
the issue appears when try make url more seo friendly, add following rewrite rule .htaccess
rewriterule ^artist/(.*).html http://mysite.com/?profile=$1
thinking should work not, goes wordpress 404 page. if redirect regular html file instead of mysite.com/?profile=$1 works fine.
does have idea what's wrong , how can working properly?
thanks
make sure rule before of wordpress rules. wordpress' rules route requests through index.php
, since "artist" bad permalink, it'll return 404.
additionally, if include http://mysite.com
in rule's target, inherently redirect browser opposed internally rewriting uri. should remove , include [l]
flag rewriting stops in current iteration (thus wordpress rules won't applied):
rewriterule ^artist/(.*).html /?profile=$1 [l]
Comments
Post a Comment