【问题标题】:Htaccess ( or + Cakephp)Htaccess(或+ Cakephp)
【发布时间】:2014-02-04 18:36:10
【问题描述】:

我想知道如何为网站配置子域。 例子 www.domain.com subdomain.domain.com

如何配置 htaccess 以访问文件夹子域并使用它

public_html
 app
 lib
 plugins
 vendors...
 subdomain
    app
    lib...

这是我的 htaccess

 <IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
 </IfModule>

谢谢

【问题讨论】:

  • 你想在子域中安装 cakephp?
  • 是的!但是主要的 cakephp 和 htaccess 不会将我重定向到我的子域文件夹.. 给出错误 '500 Internal Server Error :('

标签: apache .htaccess cakephp mod-rewrite


【解决方案1】:

在 public_html/.htaccess 中:

<IfModule mod_rewrite.c>
  RewriteEngine on

  RewriteCond    %{REQUEST_FILENAME} !subdomain/
  RewriteRule    ^$ app/webroot/    [L]   

  RewriteCond    %{REQUEST_FILENAME} !subdomain/
  RewriteRule    (.*) app/webroot/$1 [L]

</IfModule>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-11-23
    • 2011-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-17
    • 2010-11-22
    • 2015-12-03
    相关资源
    最近更新 更多