Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i have a server with apache2.2 hosting multiple virtualhosts, with a handful of domains containing a keyword(eg. "foo123") all being rewritten/redirected to another one of my hosted domains. all my other domains work as expected.

the problem is that i can't find this elusive rule anywhere.

i've checked:
my apache2.conf (multiple times)
httpd.conf (empty)
each site's config in /etc/apache2/sites-enabled & sites-available
each site's .htaccess file under /var/www/
/etc/apache2 recursively with grep (also by hand with nano)
/var/www recursively with grep
/etc/php5 recursively with grep (just to be sure)
iptables

i also checked my dns records on my host's control panel, as well as tried debugging with apache's RewriteLog(set at 4, then 9) enabled, but no such luck.

am i missing something?

share|improve this question
add comment

1 Answer

Yes, you're missing your PHP code. Apache's not the only thing that can send a 30x response to a client system. A RewriteRule or Redirect is how Apache can be configured for it, but PHP code can modify the response code and headers at will.

Take a close look at the exact HTTP request and response when you get a redirect - that should help point you (or us) in the right direction. From the information you've provided, I suspect that the PHP application feels that requests should come in with a specific host header that it's configured for, and it's redirecting those that don't fall under that header.

share|improve this answer
    
thank you for your informative answer, but after scrutinizing my configs once more i found the problem... the time old spelling error(virtualhosts ServerName), of all things! the RewriteLog was the key :) again, thanks. –  xVagabondx Jul 24 '12 at 3:06
    
e and o begin to look the same late at night –  xVagabondx Jul 24 '12 at 3:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.