Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 将cgi脚本url重写为另一个_Apache_.htaccess_Url Rewriting_Cgi_Manpage - Fatal编程技术网

Apache 将cgi脚本url重写为另一个

Apache 将cgi脚本url重写为另一个,apache,.htaccess,url-rewriting,cgi,manpage,Apache,.htaccess,Url Rewriting,Cgi,Manpage,如何重定向文件系统目录以将其映射到url 我已经在我的web服务器上安装了man2html,以便通过网站访问手册页 apt-get install man2html 我发现它是一个cgi脚本,安装在: /usr/lib/cgi-bin/man/ 安装后,它已经可以访问,没有问题,也没有配置 http://myurl.com/cgi-bin/man/man2html 我想重定向 http://myurl.com/cgi-bin/man/man2html 到 编辑: 以下是目录的ls: ls

如何重定向文件系统目录以将其映射到url

我已经在我的web服务器上安装了man2html,以便通过网站访问手册页

apt-get install man2html
我发现它是一个cgi脚本,安装在:

/usr/lib/cgi-bin/man/
安装后,它已经可以访问,没有问题,也没有配置

http://myurl.com/cgi-bin/man/man2html
我想重定向

http://myurl.com/cgi-bin/man/man2html

编辑: 以下是目录的ls:

ls -al /usr/lib/cgi-bin/man
total 88
drwxr-xr-x 2 root root  4096 Feb 28 03:28 .
drwxr-xr-x 3 root root  4096 Feb 27 11:29 ..
-rwxr-xr-x 1 root root 20672 Nov  2  2011 man2html
-rwxr-xr-x 1 root root  8250 Nov  2  2011 mansearch
-rwxr-xr-x 2 root root 19472 Nov  2  2011 mansec
-rwxr-xr-x 2 root root 19472 Nov  2  2011 manwhatis
知道同一域名正在托管wordpress博客,因此在.htaccess中:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RewriteRule ^manpages/?$ /cgi-bin/man/man2html [L]

这行不通

你试过这样做吗

RewriteEngine On
RewriteRule ^manpages/?$ /cgi-bin/man/man2html [L]

htaccess文件在根目录中。感谢您的回复。请检查问题中的我的更新。我的意思是将它放在你域的文档根htaccess文件中,而不是man文件夹中。谢谢,但它不起作用。我还在寻找。我认为wordpress hta配置可能会导致冲突。我会更新这个问题。
sudo service apache2 reload
RewriteEngine On
RewriteRule ^manpages/?$ /cgi-bin/man/man2html [L]