php - Apache rewrite - clean URLs in localhost -


i have been trying past few hours write clean urls in lamp machine.

apache's mod_rewrite enabled, , trying use .htaccess file pass url parameters index.php script @ time var_dump of _get.

my current .htaccess following (although i've tried quite few variations of found on other answers no success)

rewriteengine on  #make sure it's not actual file rewritecond %{request_filename} !-f  #make sure not directory rewritecond %{request_filename} !-d   #rewrite request index.php rewriterule ^(.*)$ index.php?/get=$1 [l] 

when point browser localhost/my_project/test, 404 error saying:

not found

the requested url /my_project/test not found on server.

apache/2.2.22 (ubuntu) server @ localhost port 80

apparently i'm missing obvious here, help?

2 things for:

  1. make sure .htaccess enabled
  2. make sure above code in my_project directory.

then add rewritebase line well:

rewriteengine on rewritebase /my_project/  #make sure it's not actual file rewritecond %{request_filename} !-f #make sure not directory rewritecond %{request_filename} !-d  #rewrite request index.php rewriterule ^(.*)$ index.php?get=$1 [l] 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -