开发者

how to run php scripts without using php extension in an adress

开发者 https://www.devze.com 2022-12-17 04:25 出处:网络
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

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

精彩评论

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