【问题标题】:Redirecting to another folder using htaccess with cake使用 htaccess 和 cake 重定向到另一个文件夹
【发布时间】:2015-06-12 12:15:27
【问题描述】:

你好,我遇到了以下情况

我们的一位开发人员目前在外面,我从未使用过 cakePHP。

我在某个域下有一个网站

http://example.com

在他的项目的 .htaccess 中,他有这个

   RewriteEngine on
   RewriteBase /
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]

但我希望当用户直接输入 http://example.com 时,他们会被重定向到根目录中的另一个页面或文件夹。

该网站托管在 godaddy 中,但如果我尝试使用他们的面板进行重定向,它会因为项目中的一个而被忽略,我只想将用户发送到“正在建设中的页面”,同时让我的客户检查他的页面的可能性,但不是对一般观众。

【问题讨论】:

    标签: .htaccess url-rewriting cakephp-2.3


    【解决方案1】:

    你可以使用:

    RewriteEngine on
    RewriteBase /
    
    RewriteRule ^/?$ page-under-construction [L,R=302]
    
    RewriteRule ^((?!page-under-construction).+)$ app/webroot/$1 [L,NC]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-18
      • 2014-11-24
      • 2016-03-23
      • 1970-01-01
      相关资源
      最近更新 更多