Issues

ZF-7477: lots of internal redirects when try to use zend framework in an alias

Issue Type: Bug Created: 2009-08-04T07:49:57.000+0000 Last Updated: 2009-09-11T16:31:06.000+0000 Status: Resolved Fix version(s): Reporter: Morteza Milani (morteza) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Controller

Related issues: Attachments: - LoginController.php

Description

Working Environment : Apache Server version 2.2.11 , PHP version 5.2.9.

I made an alias on my apache server, with this configuraion:

<pre class="highlight"> 
Alias /mysite/ "somewhere_in_my_disk/public/" 

    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Allow from all

Then I made a controller named loginController in application/controllers. it has an action named index. When I tried to have direct access to it ( using url: http://localhost/mysite/login/index or http://localhost/mysite/login/ ), an internal server error occurred:

Apache error log:

[error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Also, I could have indirect access to this action controller like this:

<pre class="highlight">

<?php $this->action('index', 'login');?>

Then I changed the alias into VirtualHost. and everything was OK.

The virtual host configuraion:

<pre class="highlight"> 

ServerName quickstart.localhost
DocumentRoot somewhere_in_my_disk/public

AllowOverride All
Allow from all

And this is my .htaccess settings:

<pre class="literal"> 
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]

Comments

Posted by Tobias Petry (ice-breaker) on 2009-09-11T16:31:05.000+0000

Not an Issue. This is a misconfiguration of apache which is out of the scope of the Zend Framework, during your endless redirects there will never be a php file called.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts