regex - GET variables not received from PHP redirect, is it a rewrite issue? -


i'm working on basic blog , trying create method edit already-created entries. know code render entry in edit view (admin page) works manually passing necessary variables in url, e.g. "localhost/simple_blog/admin.php?page=blog&url=first-entry". pulls fields database without issue.

i have .htaccess file performing rewrites, though:

rewriteengine on rewritebase /simple_blog/  rewriterule \.(gif|jpg|png|css|js|inc\.php)$ - [l] rewriterule ^admin/(\w+)(|/)$ admin.php?page=$1 [nc,l] rewriterule ^admin/(\w+)/([\w-]+) admin.php?page=$1&url=$2 [nc,l] rewriterule ^(\w+)/?$ index.php?page=$1 rewriterule ^(\w+)/([\w-]+) index.php?page=$1&url=$2 

the link edit entry in format "/simple_blog/admin/blog/first-entry", , hovering on hyperlink on page shows reference "localhost/simple_blog/admin/blog/first-entry" correct. clicking link , viewing source on page loads shows no values being received previous page, though.

i'm hoping bit more mod_rewrite , regex experience can @ me , maybe point out i'm missing, either or confirm issue not rewrite rules , elsewhere. i've triple-checked functions, receive no errors in apache, , access log merely shows "first-entry" being accessed get.

if question dupe, please feel free let me know , point me in right direction. if feel need more info/code examples, let me know that, too. :)

(yes, i'm using "php absolute beginners" jason lengstorf; i'm in chapter 7 right now.)


edit: 1 aug 2013

i've tested rules on http://htaccess.madewithlove.be/ , appears url test on matches final rule, thereby sending "index.php" way. i've checked syntax both using "php absolute beginners" book , external resources. seems check out. have idea why it's doing this?

here's screenshot of rewrite test results. screenshot

even though you've declared rewritebase, can't exclude pattern matching side of rules. lot of online testers don't support things rewritebase. try , see if works.

rewriteengine on rewritebase /simple_blog/  rewriterule \.(gif|jpg|png|css|js|inc\.php)$ - [l] rewriterule ^simple_blog/admin/([\w-]+)/?$ admin.php?page=$1 [nc,l] rewriterule ^simple_blog/admin/([\w-]+)/([\w-]+) admin.php?page=$1&url=$2 [nc,l] rewriterule ^simple_blog/([\w-]+)/([\w-]+) index.php?page=$1&url=$2 [l] rewriterule ^simple_blog/([\w-]+)/?$ index.php?page=$1 [l] 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -