如何在 Apache htaccess 中使用 cgi


How to use cgi in the Apache htaccess

我正在尝试编辑我的.htaccess,任何.test文件都将被视为phpApache网站讲述了一些关于cgi脚本的信息我的问题是如何做到这一点?感谢.htaccess: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On ## hide .php extension RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^'.]+)$ $1.php [NC,L] #set path for error pages ErrorDocument 401 /401.php ErrorDocument 404 /404.php AddHandler application/x-httpd-php .html .htm .shtml .test AddType application/x-httpd-php .html .htm .shtml .test

只需在您的.htaccess文件中更新它:

AddHandler application/x-httpd-php .html .htm .shtml .test
AddType application/x-httpd-php .html .htm .shtml .test

在其中添加以下行:

Addhandler application/x-httpd-php .html .php .test