how to run php scripts without using php extension in an adress
As in title. I want to run example.com/bar.php
by using example.com/bar
as adress, but it d开发者_如何学运维oesn't wrong. How to set it?
The simplest approach: Call it /bar/index.php
Other approaches include mod_rewrite and ForceType (assuming Apache).
If you're using apache try adding this to your .htaccess file:
RewriteEngine on
RewriteBase /
RewriteRule ^bar$ bar.php
If you're using Apache look at htaccess and mod_rewrite
精彩评论