0

As in title. I want to run example.com/bar.php by using example.com/bar as adress, but it doesn't wrong. How to set it?

  • Please take a look this [thread](http://stackoverflow.com/questions/1337695/remove-php-extension-with-php) – YOU Jan 24 '10 at 15:19

3 Answers3

6

The simplest approach: Call it /bar/index.php

Other approaches include mod_rewrite and ForceType (assuming Apache).

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
1

If you're using apache try adding this to your .htaccess file:

RewriteEngine on
RewriteBase /
RewriteRule ^bar$ bar.php
João Josézinho
  • 2,648
  • 4
  • 23
  • 27
  • It works very well, but how to change every file witch .php extension? –  Jan 24 '10 at 19:21
0

If you're using Apache look at htaccess and mod_rewrite

Joe
  • 46,419
  • 33
  • 155
  • 245