Infinite redirect loop

Discussion in 'General' started by stolenpants, Aug 23, 2010.

  1. stolenpants

    stolenpants New Member

    Using ISPConfig 3.0.1.3

    I was in the control panel messing with a domain, let's call it mydomain.com. 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/mydomain.com.vhost and I removed all the redirect statements like:

    RewriteCond %{HTTP_HOST} ^mydomain.com [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.
     
  2. Mark_NL

    Mark_NL New Member

    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..
     
  3. stolenpants

    stolenpants New Member

    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.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    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.
     
  5. stolenpants

    stolenpants New Member

    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?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    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?
     
  7. stolenpants

    stolenpants New Member

    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?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    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.

    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.
     
  9. stolenpants

    stolenpants New Member

    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 www.domain.org, 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.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

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

    stolenpants New Member

    restarted apache, no dice.

    been rebooting the entire server every step of the way just to be safe every time I make a change to something.

    I'm not sure what my options are here besides reformatting? It sounds like we're just taking shots in the dark here.
     
  12. stolenpants

    stolenpants New Member

    Here's the vhost

     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    The vhost file is ok, it does not contain anything that may cause a redirect. The redirect must be defined somwhere else. Have you defined some kind of redirect at your domain registry?

    Please post the real domain of your site so that I can test it.
     
  14. stolenpants

    stolenpants New Member

    Fixed.

    Ok here's what happened. When I started messing with the .vhost file I did this

    cp mysite.org.vhost mysite.org.backup

    I wasn't aware that .vhost file was overwritten by crons.

    I also wasn't aware that apache would go straight for the file that said .backup instead of the one that said .vhost I suppose I was thinking the file extensions mattered. Bah!

    Thanks for the help.
     

Share This Page