开发者

PHP: calling domain.com/filename/id1234

开发者 https://www.devze.com 2023-02-22 03:28 出处:网络
how do i setup my php file so it can be called from domain.com/filename.php?id=12345 to domain.com/filename/123开发者_高级运维45 ?

how do i setup my php file so it can be called from domain.com/filename.php?id=12345 to domain.com/filename/123开发者_高级运维45 ?

THANKS!


You need to use Apache's mod_rewrite

Create a file in your document root called .htaccess and place the following lines.

RewriteEngine on
RewriteRule ^filename/([0-9]+)/?$ filename.php?id=$1
0

精彩评论

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