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
  • 857,932
  • 118
  • 1,152
  • 1,264
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,576
  • 3
  • 22
  • 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
  • 44,558
  • 31
  • 143
  • 235