Thursday 15 August 2013

.htaccess - php url without extension -



.htaccess - php url without extension -

my subject different deprecated one, need string url without showing php filename. have items click , go edit.php page trying clicked string url.

e.g. if click 'abc' , want go page edit.php , browser displays :

http://localhost/abc

not

http://localhost/edit.php?item=abc

it's routing in symfony.

here illustration .htaccess file specific illustration above:

# turn on rewriting rewriteengine on # check request isn't real file (e.g. image) rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d # redirect requests blah /edit.php?item=blah rewriterule ^(.*)$ /edit.php?item=$1 [nc,l]

here docs need else http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

php .htaccess url-rewriting

No comments:

Post a Comment