【问题标题】:pyrocms installation in a subdirectory with wordpress installed in the root directorypyrocms 安装在子目录中,wordpress 安装在根目录中
【发布时间】:2010-09-28 16:38:25
【问题描述】:

已经有一段时间了,所以我想我会寻求帮助。这是根目录中 wordpress 的 .htaccess 文件:

AddHandler x-httpd-php5 .php
AddHandler x-httpd-php .php4

# BEGIN WordPress


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond $1 !^(community)(/|$)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

我基本上是在要求它忽略将安装 pyrocms 的“社区”目录。这是我在社区子目录中的 .htaccess 文件:

<IfModule mod_rewrite.c>

 Options +FollowSymLinks
 RewriteEngine on

 # NOTICE: If you get a 404 play with combinations of the following commented out lines
 #AllowOverride All
 RewriteBase /community

 # Restrict your site to only one domain
 #RewriteCond %{HTTP_HOST} !^example\.com$
 #RewriteRule ^(.*)$ http://example.com/$1 [L]

 # Keep people out of codeigniter directory and Git/Mercurial data
 RedirectMatch 403 ^/(system\/pyrocms\/cache|system\/codeigniter|\.git|\.hg).*$

 # Send request via index.php (again, not if its a real file or folder)
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d

 <IfModule mod_php5.c>
  RewriteRule ^(.*)$ index.php/$1 [L]
 </IfModule>

 <IfModule !mod_php5.c>
  RewriteRule ^(.*)$ index.php?/$1 [L]
 </IfModule>

</IfModule>

当我尝试访问 /community/installer 时收到 404(CI 404)

此外,如果我尝试不同的 uri_protocol 设置,我会得到奇怪的结果。 db 连接错误等。我已经能够显示安装程序的主页,但没有任何步骤。

有什么想法吗?没有找到任何正确配置 pyrocms 以进行子目录安装的文档。

【问题讨论】:

    标签: php wordpress .htaccess codeigniter pyro


    【解决方案1】:

    恢复您的 WordPress .htaccess(删除它,然后从面板中的永久链接选项重新生成它)。

    现在,将您的 /community/.htaccess 更改为此,

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /community
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
    </IfModule>
    

    希望对您有所帮助。

    【讨论】:

      【解决方案2】:

      你到底是为了什么?!

      我可能制作了 PyroCMS,但我拒绝支持这种精神上的东西 ;-)

      【讨论】:

      • 是的,我知道。我实际上发现这个问题根本与 .htaccess 无关。似乎与此客户端在 godaddy 共享主机上有关。
      猜你喜欢
      • 2011-01-31
      • 2012-10-08
      • 2018-02-05
      • 2013-04-26
      • 2017-05-16
      • 1970-01-01
      • 1970-01-01
      • 2017-07-12
      • 2011-05-07
      相关资源
      最近更新 更多