php - .htaccess ReWriteRule - Requested URL <rewritten filename> was not found on this server -


i've been testing in wamp , can't work. believe wamp set due error message i'm receiving , works no problem when don't use .htaccess file.

i have filename i'm using testing called feedback.php. instead of displaying www.mysite.com/feedback.php. i'm trying www.mysite.com/feedback.

.htaccess file

rewriteengine on rewriterule ^feedback.php/?$ feedback [nc] 

the error message receive

"not found
the requested url /feedback not found on server."

are there 2 files required rewriterule work?

i'm trying work index.php www.mysite.com may different monster.

what should navbar links be? right <a href="feedback.php">feedback</a> should href perhaps href="feedback" once working?


edit: had rewriterule variables backwards. instead of

rewriterule ^feedback.php/?$ feedback [nc] 

i should have

rewriterule ^feedback/$ /feedback.php [nc,l] 

the rewrite doesn't have taken place though still reads localhost/feedback.php

you may use remove .php extension pages omitting index part website:

options +followsymlinks rewriteengine on  rewritecond %{the_request} /index rewriterule ^index$ http://yourwebsite.com/         [r=301] rewritecond %{request_filename} !-d rewritecond %{request_filename}\.php -f rewriterule ^(.*)$ $1.php                            [l] 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -