-3

This is my url http://localhost/fad/admin/countries.php

i want to change url to http://localhost/fad/admin/countries

how to change this.i changed through .htaccess but it is giving page not found any one help me to solve all my website pages to remove extension

arun
  • 3
  • 2
  • Can you post your .htaccess code? You want make rule for this file or for all files? – Lukas Jahoda Jul 21 '15 at 10:50
  • http://stackoverflow.com/search?q=remove+php+extension – Zimmi Jul 21 '15 at 10:51
  • RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php For all files i want... – arun Jul 21 '15 at 10:51
  • possible duplicate of [Reference: mod\_rewrite, URL rewriting and "pretty links" explained](http://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained) – plsgogame Jul 21 '15 at 11:53

2 Answers2

0

Try this...

RewriteEngine On
RewriteRule ^countries$ countries.php [L]
edCoder
  • 1,130
  • 2
  • 18
  • 30
0

Insert this into your .htaccess:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ $1.php [QSA]

Good luck!

John Smith
  • 725
  • 3
  • 10
  • 31