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 apache 2, phusion passenger. This is on cpanel. I followed the directions to change the documentroot and have the changes stick. Here is some of the pertinent httpd.conf

  ServerName example.com
ServerAlias  www.example.com
DocumentRoot /home/example/public_html/beta/tdt3/public
ServerAdmin webmaster@example.com
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/example.com combined
CustomLog /usr/local/apache/domlogs/example.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
## User example # Needed for Cpanel::ApacheConf
UserDir disabled
UserDir enabled example
<IfModule !mod_disable_suexec.c>
    SuexecUserGroup example example
</IfModule>
ScriptAlias /cgi-bin/ /home/example/public_html/beta/tdt3/public/cgi-bin/

The trouble is if I do http://example.com it redirects to http://www.example.com/beta/tdt3/public If I use http://www.example.com it works fine. I dont know if this is a passenger deal, an apache deal or a cpanel deal. Anyone know why the non www redirects like that?

share|improve this question
    
Is this within the virtualhost directive or not? –  Rilindo Jul 9 '11 at 19:22
    
yes within the virtualhost directive –  hforbess Jul 11 '11 at 14:02
add comment

1 Answer

up vote 0 down vote accepted

It was a rewrite rule in the .htaccess. duh

share|improve this answer
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.