HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   General (
-   -   Infinite redirect loop (

stolenpants 23rd August 2010 08:40

Infinite redirect loop
Using ISPConfig

I was in the control panel messing with a domain, let's call it I wanted to redirect it to /wiki/ and not knowing the redirect types, I tried all of them to see if any would work. They did not.

I set it back to no redirect and it still goes into an infinite redirect loop.

So then I edited /etc/apache2/sites-enabled/ and I removed all the redirect statements like:

RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^/(.*)$ /wiki/$1 [R]

I also looked through httpd.conf and apache2.conf, and I can't find anything that would cause this.

Where do I need to look to fix this. I've also rebooted the server every step of the way.

Mark_NL 23rd August 2010 10:20

You know that you need to wait for the server.php cronjob to run to edit your changes to the config files and restart the services right?

the rewrite rule itself looks fine..

stolenpants 23rd August 2010 16:45

I removed all the redirect rules I can find. I am not familiar with where all the apache configs are stored and I'm not certain I got them all.

I am not familiar at all with ISPConfig or how it commits changes can you explain in detail about this process, I'm unable to find any documentation on this software, there's a few how-to mostly regarding installation and then this forum.

till 23rd August 2010 17:07

Never edit a vhost file manually. Manual editing will just mess up the setup and all manual changes will get removed automatically anyway. Thats why it does not matter much for the user where the fiel gets stored as he should not edit it.

To your original problem, set redirect in the website options to "No redirect" and do the same in alias / subdomain options if you added any. Then wait a few minutes and try again.

Regarding the redirection, you can use this only if the cms or wiki that you installed does not use any .htaccess files. Otherwise the redirect rules from ispconfig maight interfere with the .htaccess file and will cause redirect problems.

In generella it is not recommended to use a different root dierctory if the website cinatins any active scripts like php. If you need a separate directory for a subdomain, then create a new website for that subdomain.

stolenpants 23rd August 2010 17:35

I have the site set to "no redirect" It's been set to this since the initial problem. The "no redirect" setting in ISPConfig is basically being ignored, I set it to this as as soon as I got the first re-direct loop.

I edited the vhost file manually because the system is ignoring the re-direct setting in the web interface. Either way it doesn't matter because even with all the redirects deleted from the vhost file, it continues to do the re-direct loop.

I deleted the subdomain to get rid of the redirect for it. No dice.

I'll deal with the actual redirect later but I'm trying to get my site back online now and I just want all redirects shut off. I did RewriteEngine off in the vhost to try and stop this, and nothing. My other sites are working fine, it's just this one. I can't find any additional config files.

Where is ISPconfig storing this config data? What file does it read when it overwrites the vhost? How often does it push these changes? What triggers it, besides a cron, to do this. Where is the cron file stored?

till 23rd August 2010 17:38


I can't find any additional config files.
Because there are no additional config files.

1) Take a look at the ispconfig monitor, are there any pending jobs in the jobqueue?
2) Any errors or warnings in the system log in the ispconfig monitor?

stolenpants 23rd August 2010 17:51

There are no jobs pending. I don't see anything in the system log.

I added the following to httpd.conf

RewriteEngine On
RewriteLog "/var/www/rewrite.log"
RewriteLogLevel 5

Maybe I'll be able to find some evidence this way.

Is it possible that something other than mod_rewrite is doing this?

till 23rd August 2010 17:54


There are no jobs pending. I don't see anything in the system log.
Ok. Then ispconfig was able to write all changes to disk without errors.

You should also check if there are any .htaccess files in the web directory of the website.


Is it possible that something other than mod_rewrite is doing this?
Yes, redirects can be done by any kind of script. e.g. php script in the website. If you installed a cms or wiki in the website, then it might be the software that redirects you in a infinite loop.

It might also be a problem of the browser cache, so close your browser and try again.

stolenpants 23rd August 2010 18:08

Went to log level 9, still nothing. Still in a loop.

There is a .htaccess file but it appears to be blank.

If I go to, it redirects. The only thing in there is an index.html file. mediawiki is installed at /wiki/ but it shouldn't be affecting this.

Cleared browser cache, reset, still nothing. Go to the URL and it keeps adding /wiki/wiki/wiki/wiki/wiki until the browser errors out.

till 23rd August 2010 18:09

Try to restart apache. If this dont help, post the vhost file for this website.

All times are GMT +2. The time now is 20:37.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.