0

Am using 'xampp' in windows 7. I have my index.php in a folder under the localhost(root) and the path would be like (http://localhost/folder/index.php) And i added the below lines in the file '.htaccess' which i have placed under the folder

RewriteEngine On
RewriteRule index index.php [L]

But its not working. Help me.

3 Answers3

0

try this

RewriteEngine On

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*)$ $1\.php

also enable Rewrite module

NLSaini
  • 257
  • 1
  • 10
0
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php?%{QUERY_STRING}
long
  • 3,692
  • 1
  • 22
  • 38
0

Try

    RewriteEngine On
    RewriteRule ^index$ index.php [NC,L]
s3nzoM
  • 1,544
  • 1
  • 9
  • 17
  • not working, where to place '.htaccess' file? –  Jan 29 '14 at 13:23
  • 'RewriteEngine On RewriteRule index.php index [L]' This is working fine in [link](http://htaccess.madewithlove.be/), but not working in browser. –  Jan 29 '14 at 13:47