.htaccess rewrite rule confusion/conflicts -


i have below rewrite rules setup on site. i' trying set have below different urls.

current .htaccess

options +followsymlinks rewriteengine on rewritebase /  rewriterule ^([^-]*)/$ ?action=$1 [l] rewriterule ^([^-]*)-([^-]*)/$ ?action=$1&id=$2 [l] 

required urls

www.site.com www.site.com/page/ www.site.com/product-1234/ www.site.com/privacy-policy/ 

the problem second rewrite rule affecting privacy-polcy url shouldn't second rewrite rule specific product pages have product id in it.

i'm trying ignore directories exist structure of site under root have below directories don't want rewrite rules affect user shouldn't know these directories.

/system/ /tasks/ 

# catch more specific urls: rewriterule ^product-([0-9]*)/$ ?action=product&id=$1 [l]  # ignore requests want files or directories exist: rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d # continue less specific: rewriterule ^([^/]*)/$ ?action=$1 [l] 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -