0

I referred alexcican website and put the code in my htaccess.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L] 

It works in my localhost, but doesn't work in thesvn link or live website. Please help.

Vinoth Krishnan
  • 2,925
  • 6
  • 29
  • 34
codieboie
  • 52
  • 2
  • 10

3 Answers3

0

Are you using apache server? Check if you have mod_rewrite enabled.

Bink
  • 21
  • 3
0

Just in case, if you have created any folder on you live website for your code, than try using below line

RewriteBase /yourFolderName/

keep above code just below RewriteEngine On

Rima
  • 81
  • 3
0

This one worked for me:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

## don't touch /forum URIs
RewriteRule ^forums/ - [L,NC]

## hide .php extension snippet

# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L]

# To internally forward /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [L]
codieboie
  • 52
  • 2
  • 10