重定向cgi-bin目录
我的旧网站有很多使用 cgi-bin 目录的网址 例如:www.website.com/cgi-bin/etc?123
现在该网站位于运行 WordPress 的新服务器上,我想将其重定向到: www.website.com/etc/123
问题是我收到了 404 错误,这些错误没有被 wordpress 处理,甚至创建一个 direcotry cgi-bin 也会做同样的事情。
我不太确定是否可以通过 .htaccess 做到这一点 或者这与 PHP.ini 设置甚至 apache 有关?
如何 URL 重定向 cgi-bin?由于 cgi-bin 不再被使用,现在它是通过 wordpress 处理的。
谢谢
My Old site had a lot of urls using the cgi-bin directory
eg : www.website.com/cgi-bin/etc?123
Now the site is now on a new server running wordpress, and I want to redirect this to :
www.website.com/etc/123
The problem is I am getting 404 errors that are not being processed by wordpress, and even creating a direcotry cgi-bin does the same thing.
I am not too sure if I can do this via .htaccess
Or is this to do with a PHP.ini setting or even apache?
How can I URL redirect the cgi-bin? As cgi-bin is no longer being used, and nows it is being handled via wordpress.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以创建从 cgi-bin 到新目标的符号链接:
查看“ln”的手册页以了解该命令的完整处理。如果您没有 shell 访问权限,您的 Web 服务器前端(例如 cPanel)可能可以创建此类链接。
也就是说,考虑到 cgi-bin 的特殊意义和 Web 服务器的处理方式,cgi-bin 的重定向可能不是一个好的长期解决方案。在更新 Wordpress 中的路径时,使用重定向来保持运行,然后删除重定向。
You can create a symbolic link from cgi-bin to the new destination:
Review the man pages for "ln" for a full treatment of that command. If you don't have shell access, your web server front-end (e.g. cPanel) can probably create such links.
That said, a redirect of cgi-bin is probably not a good long-term solution, given cgi-bin's special significance and handling by the web server. Use a redirect to keep things running while you work through updating the paths in Wordpress, then remove the redirect.
如果您有 mod_rewrite 可用并且我已经正确理解您想要的内容,您可以使用以下规则集将 cgi-bin URL 重定向到新 URL:
If you have mod_rewrite available and I've correctly understood what you wanted, you can redirect the cgi-bin URLs to the new URLs with the following rule set: