.htaccess rewrite with file path as parameter -


i have following working:

rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d  ### rewrite url ### # basic rewrite pages in admin area rewriterule ^admin/([a-z/]*)$ /private/admin/index.php?path=$1 [l,qsa] 

so url someting like: admin/overview/overview making overview/overview path. working fine add parameter used id (for deleting / editing). added following rule:

rewriterule ^admin/([a-z/]*)/([a-za-z0-9]*)$ /private/admin/index.php?path=$1&id=$2 [l,qsa] 

this not working: admin/overview/overview/34 behind admin/ seen path including 34. when tried:

rewriterule ^admin/([a-z/]*)-([a-za-z0-9]*)$ /private/admin/index.php?path=$1&id=$2 [l,qsa] 

making url admin/overview/overview-34, still didn't work. tried place line on different locations (before , after rewriterule ^admin/([a-z/]*)$ /private/admin/index.php?path=$1 [l,qsa])

i hope can me problem or give me alternative way of doing this.

this should work :

rewriterule ^admin/([^/]*)/([^/]*)/([^/]*)/?$ /private/admin/index.php?path=$1/$2&id=$3 [l,qsa] 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -