开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜