I've upgraded my Apache 2.2 web server to 2.4 today and then some Wordpress installations started to get infinite loops from non-www to www and from www to non-www :(
Removing .htaccesss didn't helped.
How to solve this ? Example domain config:
SetEnvIf X-Forwarded-Proto https HTTPS=1 ServerAdmin [email protected] ServerName internet.az.pl ServerAlias www.internet.az.pl DocumentRoot "/home/admin2/komputery" DirectoryIndex index.php index.html index.shtml index.htm index.pl index.py index.cgi index.rb default.htm Default.aspx Default.asp ScriptAlias /cgi-bin/ "/home/admin2/internet.az.pl/cgi-bin/" <IfModule mod_fastcgi.c> Alias /internet.az.pl.0fake "/home/admin2/komputery/internet.az.pl.0fake" #FastCGIExternalServer "/home/admin2/komputery/internet.az.pl.0fake" -host 127.0.0.1:52474 -idle-timeout 300 -pass-header Authorization FastCGIExternalServer "/home/admin2/komputery/internet.az.pl.0fake" -socket /opt/configs/php-fpm/sock/admin2.sock -idle-timeout 300 -pass-header Authorization AddType application/x-httpd-fastphp .php Action application/x-httpd-fastphp /internet.az.pl.0fake <Files "internet.az.pl.0fake"> RewriteCond %{REQUEST_URI} !internet.az.pl.0fake </Files> </IfModule> <Directory "/home/admin2/komputery/"> AllowOverride All <IfVersion < 2.4> Order allow,deny Allow from all </IfVersion> <IfVersion >= 2.4> Require all granted </IfVersion> Options +ExecCGI <FilesMatch \.(cgi|pl)$> SetHandler cgi-script </FilesMatch> </Directory> <IfModule mod_php5.c> php_admin_value sendmail_path "/usr/sbin/sendmail -t -i" php_admin_value sendmail_from "internet.az.pl" Include /home/kloxo/client/admin2/prefork.inc </IfModule> <Location "/"> Allow from all Options -Indexes -FollowSymlinks +SymLinksIfOwnerMatch <IfModule mod_php5.c> php_admin_value open_basedir "/home/admin2:/tmp:/usr/share/pear:/var/lib/php/session/:/home/kloxo/httpd/script:/home/kloxo/httpd/disable/:/usr/bin" </IfModule> </Location> CustomLog "/home/httpd/internet.az.pl/stats/internet.az.pl-custom_log" combined ErrorLog "/home/httpd/internet.az.pl/stats/internet.az.pl-error_log" and also httpd.conf:
 ServerTokens Prod ServerRoot "/etc/httpd" # MR -- must be disable here because can not overrite! -- importance for proxy-to-apache # Listen 80 Include conf.modules.d/*.conf User apache Group apache ServerAdmin root@localhost <Directory /> AllowOverride none Require all denied </Directory> DocumentRoot "/var/www/html" <Directory "/var/www"> AllowOverride None # Allow open access: Require all granted </Directory> # Further relax access to the default document root: <Directory "/var/www/html"> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> <IfModule dir_module> DirectoryIndex index.html </IfModule> <Files ".ht*"> Require all denied </Files> ErrorLog "logs/error_log" LogLevel error <IfModule log_config_module> ## MR -- change %h to %a to fix mod_remoteip issue LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%a %l %u %t \"%r\" %>s %b" common <IfModule logio_module> LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> CustomLog "logs/access_log" combined </IfModule> <IfModule alias_module> # Alias /webpath /full/filesystem/path ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" </IfModule> <Directory "/var/www/cgi-bin"> AllowOverride None Options None Require all granted </Directory> <IfModule mime_module> TypesConfig /etc/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz #AddHandler cgi-script .cgi #AddHandler type-map var AddType text/html .shtml AddOutputFilter INCLUDES .shtml </IfModule> AddDefaultCharset UTF-8 <IfModule mime_magic_module> MIMEMagicFile conf/magic </IfModule> Alias /error/ "/home/kloxo/httpd/error/" <IfModule mod_negotiation.c> <IfModule mod_include.c> <Directory "/home/kloxo/httpd/error/"> AllowOverride None Options IncludesNoExec AddOutputFilter Includes html AddHandler type-map var <IfVersion < 2.4> Order allow,deny Allow from all </IfVersion> <IfVersion >= 2.4> Require all granted </IfVersion> LanguagePriority en es de fr ForceLanguagePriority Prefer Fallback </Directory> #ErrorDocument 500 "The server made a boo boo." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" #ErrorDocument 402 http://www.example.com/subscription_info.html ErrorDocument 401 /error/401.html ErrorDocument 403 /error/403.html ErrorDocument 404 /error/404.html ErrorDocument 500 /error/500.html ErrorDocument 501 /error/501.html ErrorDocument 503 /error/503.html ErrorDocument 504 /error/504.html </IfModule> </IfModule> EnableSendfile on IncludeOptional conf.d/*.conf