How to execute a PHP web page without the .php extension in the URL?

后端 未结 6 640
野趣味
野趣味 2021-02-01 06:24

Sorry for noob question, can\'t understand from what I should search.

I\'m making a site with that page product.php?id=777
I\'d like it to be pro

6条回答
  •  难免孤独
    2021-02-01 07:14

    I did this for years using the following to execute a file named "Support" (NOT Support.php, I did NOT want two ways to gain access to the file).

    
        SetHandler php-script
    
    

    However, I've started running into trouble with this when using Plesk to execute scripts as PHP 7.0. The root (.com/index.php) would run as PHP 7 just fine but any of my php-script files (.com/Support) would run as my version of Plesk's default PHP 5.4. I've yet to figure out why it's doing that, but it does get around the problem of setting a default handler.

提交回复
热议问题