【问题标题】:.htaccess redirect root to cgi-bin Wordpress.htaccess 将根目录重定向到 cgi-bin Wordpress
【发布时间】:2010-11-24 02:25:25
【问题描述】:

我正在与需要在 cgi-bin 中安装 Wordpress 的学校合作。

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

例子:

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

还有可能从 URL 中完全“隐藏”cgi-bin 吗?显然,我无法将 Wordpress 文件从 cgi-bin 移动到 /my-dept/ 根目录。

提前致谢。

【问题讨论】:

    标签: wordpress .htaccess redirect cgi-bin


    【解决方案1】:
    RewriteEngine on
    RewriteRule ^/$ /cgi-bin/
    

    ...如果你安装了 mod_rewrite

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

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

    redirect 301 / /cgi-bin/
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-21
      • 1970-01-01
      • 2021-07-08
      • 2012-04-27
      • 1970-01-01
      • 2021-04-04
      • 2013-09-22
      • 2017-06-26
      相关资源
      最近更新 更多