.htaccess 将 root 重定向到 cgi-bin WordPress

发布于 2024-10-04 14:55:55 字数 265 浏览 0 评论 0原文

我正在与一所学校合作,要求将 WordPress 安装在 cgi-bin 中。

我想将 htaccess 放在 public_html 文件夹中,以便它重定向到 cgi-bin。

示例:

从 /dept/my-dept/ 重定向到 /dept/my-dept/cgi-bin?

是否可以完全从 URL 中“隐藏”cgi-bin?显然,我无法将 WordPress 文件从 cgi-bin 移动到 /my-dept/ 根目录。

提前致谢。

I'm working with a school that requires Wordpress to be installed in the cgi-bin.

I'd like to put an htaccess in the public_html folder so it redirects to the cgi-bin.

Example:

Redirect from /dept/my-dept/ to /dept/my-dept/cgi-bin?

Also is it possible to "hide" the cgi-bin from the URL altogether? Obviously, I can't move the Wordpress files from cgi-bin to the /my-dept/ root directory.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

临走之时 2024-10-11 14:55:55
RewriteEngine on
RewriteRule ^/$ /cgi-bin/

...如果您安装了 mod_rewrite

请参阅:http://httpd.apache.org /docs/2.0/misc/rewriteguide.html

您还可以执行 301 重定向,例如:

redirect 301 / /cgi-bin/

...但是使用第二种方法 cgi-bin 仍然可见。

RewriteEngine on
RewriteRule ^/$ /cgi-bin/

...If you have mod_rewrite installed

See: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

You could also do a 301 redirect like:

redirect 301 / /cgi-bin/

...But cgi-bin will still be visible with the second method.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文