You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tim Dunphy <bl...@gmail.com> on 2014/12/31 19:45:03 UTC

[users@httpd] Apache 2.4 This webpage has a redirect loop

Hey all,

 OK so I have a website that's entering a re-direct loop that prevents the
site from working.

The site's default behavior is to go from / to site/universalpictures. And
from there it enters the redirect loop and stops working.

Here's the vhost for the site in question:

<VirtualHost *:80>
        DocumentRoot /var/www/qa/launchpadnew/site
        ServerName launchpadnew.upqa.com
        ServerAlias launchpad2.upqa.com test-launchpad.upqa.com
        <Directory /var/www/qa/launchpadnew/site>
                Options -Indexes +FollowSymLinks -MultiViews -Includes
-ExecCGI
                #Options +Indexes +FollowSymLinks +MultiViews +Includes
+ExecCGI
                AllowOverride All

                Order deny,allow
                Deny from all

                AuthType Basic
                AuthName UPQA
                AuthUserFile /var/www/qa/etc/http.passwd
                AuthGroupFile /var/www/qa/launchpadnew/conf/groups
                require valid-user
                satisfy any
        </Directory>
</VirtualHost>


>From there the site encounters an .htaccess file that has the following in
it:

php_flag zlib.output_compression off
php_flag magic_quotes_gpc off

AddOutputFilter INCLUDES .html
AddOutputFilter INCLUDES .htm

AddHandler cgi-script .pl
AddHandler php5-script php

RewriteEngine on
RewriteRule ^new$ new_site.php [QSA,L]
RewriteRule ^site/(.*)$ edit_site.php?site=$1 [QSA,L]

The only errors I see in the logs are this one, repeating over and over
again:

[Wed Dec 31 11:43:06.174003 2014] [:error] [pid 9053:tid 47022521411904]
[client64.210.199.232:64956] PHP Notice:  Undefined index: action in
/var/www/qa/launchpadnew/site/edit_site_ajax.php on line 43, referer:
http://launchpadnew.upqa.com/site/Firstsite

However I'm not sure if that pertains to the error I'm experiencing.

If it's of any use, line 43 from that eror log starts at the switch
statement in the following:

//echo "POST:".$_POST['action'];
switch ($_POST['action']) {
  case 'deployFiles':


I'd appreciate any advice you may have in correcting this problem!

Thanks,
Tim

-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

Re: [users@httpd] Apache 2.4 This webpage has a redirect loop

Posted by Tim Dunphy <bl...@gmail.com>.
Hi Frank,

Your second rule is mostly abusing mod_rewrite - you should use
FallbackResource instead, or just add a RewriteCond before the rule to
prevent loops in the per directory context.


OK thanks for that suggestion. I'll give FallbackResource a shot! I wasn't
actually the one to write these originally. They were originally done on an
Apache 2.2 instance. But I have to migrate the config to Apache 2.4

I am curious about how you'd handle this as a RewriteCond tho! Apache
rewrites aren't exactly my strongest area. Although I've always wanted to
get better at doing them. Do you think you could provide an example of how
you could handle that as a rewrite? Id' appreciate it, but no big deal if
you don't have the time.

Thanks,
Tim

On Sat, Jan 3, 2015 at 11:19 AM, Francois Gingras <
francois.gingras@gmail.com> wrote:

> Your second rule is mostly abusing mod_rewrite - you should use
> FallbackResource instead, or just add a RewriteCond before the rule to
> prevent loops in the per directory context.
>
> Frank
>
> On Wed, Dec 31, 2014 at 1:45 PM, Tim Dunphy <bl...@gmail.com> wrote:
>
>> Hey all,
>>
>>  OK so I have a website that's entering a re-direct loop that prevents
>> the site from working.
>>
>> The site's default behavior is to go from / to site/universalpictures.
>> And from there it enters the redirect loop and stops working.
>>
>> Here's the vhost for the site in question:
>>
>> <VirtualHost *:80>
>>         DocumentRoot /var/www/qa/launchpadnew/site
>>         ServerName launchpadnew.upqa.com
>>         ServerAlias launchpad2.upqa.com test-launchpad.upqa.com
>>         <Directory /var/www/qa/launchpadnew/site>
>>                 Options -Indexes +FollowSymLinks -MultiViews -Includes
>> -ExecCGI
>>                 #Options +Indexes +FollowSymLinks +MultiViews +Includes
>> +ExecCGI
>>                 AllowOverride All
>>
>>                 Order deny,allow
>>                 Deny from all
>>
>>                 AuthType Basic
>>                 AuthName UPQA
>>                 AuthUserFile /var/www/qa/etc/http.passwd
>>                 AuthGroupFile /var/www/qa/launchpadnew/conf/groups
>>                 require valid-user
>>                 satisfy any
>>         </Directory>
>> </VirtualHost>
>>
>>
>> From there the site encounters an .htaccess file that has the following
>> in it:
>>
>> php_flag zlib.output_compression off
>> php_flag magic_quotes_gpc off
>>
>> AddOutputFilter INCLUDES .html
>> AddOutputFilter INCLUDES .htm
>>
>> AddHandler cgi-script .pl
>> AddHandler php5-script php
>>
>> RewriteEngine on
>> RewriteRule ^new$ new_site.php [QSA,L]
>> RewriteRule ^site/(.*)$ edit_site.php?site=$1 [QSA,L]
>>
>> The only errors I see in the logs are this one, repeating over and over
>> again:
>>
>> [Wed Dec 31 11:43:06.174003 2014] [:error] [pid 9053:tid 47022521411904]
>> [client64.210.199.232:64956] PHP Notice:  Undefined index: action in
>> /var/www/qa/launchpadnew/site/edit_site_ajax.php on line 43, referer:
>> http://launchpadnew.upqa.com/site/Firstsite
>>
>> However I'm not sure if that pertains to the error I'm experiencing.
>>
>> If it's of any use, line 43 from that eror log starts at the switch
>> statement in the following:
>>
>> //echo "POST:".$_POST['action'];
>> switch ($_POST['action']) {
>>   case 'deployFiles':
>>
>>
>> I'd appreciate any advice you may have in correcting this problem!
>>
>> Thanks,
>> Tim
>>
>> --
>> GPG me!!
>>
>> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
>>
>>
>


-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

Re: [users@httpd] Apache 2.4 This webpage has a redirect loop

Posted by Francois Gingras <fr...@gmail.com>.
Your second rule is mostly abusing mod_rewrite - you should use
FallbackResource instead, or just add a RewriteCond before the rule to
prevent loops in the per directory context.

Frank

On Wed, Dec 31, 2014 at 1:45 PM, Tim Dunphy <bl...@gmail.com> wrote:

> Hey all,
>
>  OK so I have a website that's entering a re-direct loop that prevents the
> site from working.
>
> The site's default behavior is to go from / to site/universalpictures. And
> from there it enters the redirect loop and stops working.
>
> Here's the vhost for the site in question:
>
> <VirtualHost *:80>
>         DocumentRoot /var/www/qa/launchpadnew/site
>         ServerName launchpadnew.upqa.com
>         ServerAlias launchpad2.upqa.com test-launchpad.upqa.com
>         <Directory /var/www/qa/launchpadnew/site>
>                 Options -Indexes +FollowSymLinks -MultiViews -Includes
> -ExecCGI
>                 #Options +Indexes +FollowSymLinks +MultiViews +Includes
> +ExecCGI
>                 AllowOverride All
>
>                 Order deny,allow
>                 Deny from all
>
>                 AuthType Basic
>                 AuthName UPQA
>                 AuthUserFile /var/www/qa/etc/http.passwd
>                 AuthGroupFile /var/www/qa/launchpadnew/conf/groups
>                 require valid-user
>                 satisfy any
>         </Directory>
> </VirtualHost>
>
>
> From there the site encounters an .htaccess file that has the following in
> it:
>
> php_flag zlib.output_compression off
> php_flag magic_quotes_gpc off
>
> AddOutputFilter INCLUDES .html
> AddOutputFilter INCLUDES .htm
>
> AddHandler cgi-script .pl
> AddHandler php5-script php
>
> RewriteEngine on
> RewriteRule ^new$ new_site.php [QSA,L]
> RewriteRule ^site/(.*)$ edit_site.php?site=$1 [QSA,L]
>
> The only errors I see in the logs are this one, repeating over and over
> again:
>
> [Wed Dec 31 11:43:06.174003 2014] [:error] [pid 9053:tid 47022521411904]
> [client64.210.199.232:64956] PHP Notice:  Undefined index: action in
> /var/www/qa/launchpadnew/site/edit_site_ajax.php on line 43, referer:
> http://launchpadnew.upqa.com/site/Firstsite
>
> However I'm not sure if that pertains to the error I'm experiencing.
>
> If it's of any use, line 43 from that eror log starts at the switch
> statement in the following:
>
> //echo "POST:".$_POST['action'];
> switch ($_POST['action']) {
>   case 'deployFiles':
>
>
> I'd appreciate any advice you may have in correcting this problem!
>
> Thanks,
> Tim
>
> --
> GPG me!!
>
> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
>
>