我建立一个应用程序在Zend框架目前并测试它的所有地方。我已经甲基苯丙胺亲为我的网服务器和我有一个自签署SSL这一切似乎工作。我的问题是当我试着做mod_rewrite-我只是得到404页。

我有事情设立(这可能不是最好的方式...)


在甲基苯丙胺我有2virtualhosts设立的两个指向同一网目录(安装/public/):

  • secure.myapp.com
  • myapp.com

在我的公开目录是我的index.php 文件和我的。就文件。内容。要文件是:

SetEnv APPLICATION_ENV development
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

当我参观 http://myapp.com 一切路线,因为它应该利用mod_rewrite.但是当我去 https://secure.myapp.com 索引页面是好的,但URL路由停止工作,并且看起来是这的.就文件已被忽略。

在我ssl。conf我有以下几种:

<IfModule mod_ssl.c>

Listen 443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl
SSLPassPhraseDialog  builtin
SSLSessionCache         dbm:/Applications/MAMP/logs/ssl_scache
SSLSessionCacheTimeout  300
SSLMutex  file:/Applications/MAMP/logs/ssl_mutex

<VirtualHost _default_:443>

SSLEngine on
DocumentRoot "/webroot/public"
ServerName secure.myapp.com
ServerAdmin you@example.com
ErrorLog /Applications/MAMP/logs/ssl_error_log
TransferLog /Applications/MAMP/logs/ssl_access_log

SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /Applications/MAMP/conf/apache/ssl_cert/server.crt
SSLCertificateKeyFile /Applications/MAMP/conf/apache/ssl_key/server.key

CustomLog /Applications/MAMP/logs/ssl_request_log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>

</IfModule>

没有任何人有任何想法吗?我将感谢您的帮助,因为它是严重阻碍了我的发展!

有帮助吗?

解决方案

嗯,我很确定我有这个工作。基本上,一个大问题我不得不那是甲基苯丙胺不存储虚拟主机.conf作为一个无障碍的文件。相反,这是一个混淆应用程序的文件。

我认为会发生什么情况是,virtualhosts是所有动态创建的所有标准http口,在我的情况下,80.但是我需要的是能够接入口433虚拟主机的配置,以使FileInfo.所以我的解决方法是甩掉我的。就文件,并坚持以下的所有进入我的ssl。conf文件。

<IfModule mod_ssl.c>

Listen 443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl
SSLPassPhraseDialog  builtin
SSLSessionCache         dbm:/Applications/MAMP/logs/ssl_scache
SSLSessionCacheTimeout  300
SSLMutex  file:/Applications/MAMP/logs/ssl_mutex

<VirtualHost mysite.com:443>

    SSLEngine on
    DocumentRoot /webroot/secure
    ServerName mysite.com
    ServerAdmin you@example.com
    ErrorLog /Applications/MAMP/logs/ssl_error_log
    TransferLog /Applications/MAMP/logs/ssl_access_log

    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile /Applications/MAMP/conf/apache/ssl_cert/server.crt
    SSLCertificateKeyFile /Applications/MAMP/conf/apache/ssl_key/server.key

    CustomLog /Applications/MAMP/logs/ssl_request_log \
              "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

    DirectoryIndex index.php

        <IfModule mod_rewrite.c>
            RewriteEngine on
            RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -s [OR]
            RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -l [OR]
            RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d

            RewriteRule ^.*$ - [NC,L]
            RewriteRule ^.*$ /index.php [NC,L]

            RewriteLog /Applications/MAMP/logs/ssl_rewrite_log
            RewriteLogLevel 3
        </IfModule>

</VirtualHost>

</IfModule>

我不得不添加DOCUMENT_ROOT在我面前文件和目录检查,并正斜线在前面index.php.如果我能把这个变成一个"目录",那么我认为我可以避免这些变化,但Apache不会重新启动的时候,我添加这一参数。

我唯一没有尝试增加的信息,以便甲基苯丙胺的httpd.conf,但是我有一种感觉相同的限制可能在的地方。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top