How to fix RewriteRule recursion?

157 views Asked by At

I am running tine (tine20.org) on an Ubuntu 12.04 server using Plesk to configure it. In Plesk I have a subdomain (tine.mydomain.com). In the webserver configuration of this subdomain I added those lines:

RewriteEngine on
RewriteRule /Microsoft-Server-ActiveSync(.*) /index.php?frontend=activesync [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]

I copied it from the Tine wiki: https://www.tine20.org/wiki/index.php/Admins/Synchronisation

When I try to connect to tine.mydomain.com/Microsoft-Server-ActiveSync I get an Error 500 and in the log those lines:

[Fri Nov 21 19:46:36 2014] [debug] core.c(3112): [client 2.206.3.119] r->uri = /phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/Microsoft-Server-ActiveSync
[Fri Nov 21 19:46:36 2014] [debug] core.c(3118): [client 2.206.3.119] redirected from r->uri = /phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/Microsoft-Server-ActiveSync
[Fri Nov 21 19:46:36 2014] [debug] core.c(3118): [client 2.206.3.119] redirected from r->uri = /phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/Microsoft-Server-ActiveSync
[Fri Nov 21 19:46:36 2014] [debug] core.c(3118): [client 2.206.3.119] redirected from r->uri = /phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/Microsoft-Server-ActiveSync
[Fri Nov 21 19:46:36 2014] [debug] core.c(3118): [client 2.206.3.119] redirected from r->uri = /phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/Microsoft-Server-ActiveSync
[Fri Nov 21 19:46:36 2014] [debug] core.c(3118): [client 2.206.3.119] redirected from r->uri = /phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/Microsoft-Server-ActiveSync
[Fri Nov 21 19:46:36 2014] [debug] core.c(3118): [client 2.206.3.119] redirected from r->uri = /phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/Microsoft-Server-ActiveSync
[Fri Nov 21 19:46:36 2014] [debug] core.c(3118): [client 2.206.3.119] redirected from r->uri = /phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/Microsoft-Server-ActiveSync
[Fri Nov 21 19:46:36 2014] [debug] core.c(3118): [client 2.206.3.119] redirected from r->uri = /phppath/cgi_wrapper/phppath/cgi_wrapper/Microsoft-Server-ActiveSync
[Fri Nov 21 19:46:36 2014] [debug] core.c(3118): [client 2.206.3.119] redirected from r->uri = /phppath/cgi_wrapper/Microsoft-Server-ActiveSync
[Fri Nov 21 19:46:36 2014] [debug] core.c(3118): [client 2.206.3.119] redirected from r->uri = /Microsoft-Server-ActiveSync
[Fri Nov 21 19:46:36 2014] [debug] mod_deflate.c(700): [client 2.206.3.119] Zlib: Compressed 621 to 379 : URL /phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/Microsoft-Server-ActiveSync 

So there's some kind of recursion but I don't know why and how to fix it. How do I fix it?

1

There are 1 answers

2
unixmiah On

Try adding this to your .htaccess and give it a try

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

Have you reloaded or restarted apache?

/etc/init.d/apache reload

If you have to put this in between your virtualhost but you should put this in your .htaccess of the directory where you're trying to access.

I'm hoping your have your virtualhost/tine.mydomain.com setup correctly to have these rules in your .httpd conf.