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.

4
  • @Rikesh i tried its not working Commented Jan 29, 2014 at 12:18
  • Make sure you have mod_rewrite on at your server. Commented Jan 29, 2014 at 12:18
  • @Rikesh yeah its available Commented Jan 29, 2014 at 12:23
  • Make sure allowoverride is set to ALL Commented Jan 29, 2014 at 12:27

3 Answers 3

0

try this

RewriteEngine On

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

also enable Rewrite module

Sign up to request clarification or add additional context in comments.

2 Comments

check your Rewrite module enable or not? stackoverflow.com/questions/3131236/…
@Saini yeah its there
0
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php?%{QUERY_STRING}

2 Comments

not working, where to place '.htaccess' file?
@sufi, it works, enable mod_rewrite
0

Try

    RewriteEngine On
    RewriteRule ^index$ index.php [NC,L]

2 Comments

not working, where to place '.htaccess' file?
'RewriteEngine On RewriteRule index.php index [L]' This is working fine in link, but not working in browser.