apache - .htacces URL rewrite issue: rewrites the URL with the same variable -


i want rewrite urls like:

http://domain.com/edit.php?proname=abc 

to:

http://domain.com/abc 

this current rewrite code in .htaccess :

rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([a-za-z0-9-]+)$ edit.php?proname=$1 [l,qsa] rewriterule ^([a-za-z0-9-]+)/$ edit.php?proname=$1 [l,qsa] 

the code 'kinda' works. problem rewrites 'edit' url same variable. example, have table 3 projects , each project has 'edit' button.when click on 'edit' button project 2 or 3, refers me edit page of project 1. edit links refers me edit page of first project.

what may cause it?

solved: turns out there logic error in php script. thank you, olaf!

the htaccess can simplified, looks correct far. problem must edit.php script.

n.b.: can reduce 2 rules 1 rule

rewriterule ^([a-za-z0-9-]+)/?$ edit.php?proname=$1 [l,qsa] 

but doesn't solve problem.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -