1

私は、opensuse 12.2 os、apache 2.2、zend フレームワーク 2 を使用しています。フレームワークのスケルトン アプリを使用するために、Apache のファイルに仮想ホストを設定しました。ここに定義があります

   <VirtualHost 127.0.0.1>
       DocumentRoot "/home/gabriele/Web/zf2-tutorial/public/"
       ServerName zf2-tutorial.localhost
       SetEnv APPLICATION_ENV "development" 
       <Directory "/home/gabriele/Web/zf2-tutorial/public/">
             Options +FollowSymLinks
             AllowOverride All
             DirectoryIndex index.php 
             AllowOverride None
             Order allow,deny
             Allow from all
       </Directory>
   </VirtualHost>

zf2-tutorial.localhost に移動すると、ようこそのページが表示されます。htaccessをやってみた

     Options +FollowSymlinks
     RewriteEngine On
     # The following rule tells Apache that if the requested filename
     # exists, simply serve it.
     RewriteCond %{REQUEST_FILENAME} -s [OR]
     RewriteCond %{REQUEST_FILENAME} -l [OR]
     RewriteCond %{REQUEST_FILENAME} -d
     RewriteRule ^.*$ - [NC,L]
     RewriteRule ^.*$ index.php [NC,L]

     The structure of my folder is :
     \home
           \gabriele 
                    \Web
                         \zf2-tutorial
                                     \public
                                            -index.php
                                            -htaccess

zf2-tutorial.localhost/test1234 に進むと、通常の Apache エラーが表示される代わりに、スケルトン内でリダイレクトされたエラーが表示されるはずです。

4

1 に答える 1