Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say I have the domain "" which works both with and without the "www." prefix.

And let's say I have a folder thereon called "extra".

When someone visits I would expect Apache to redirect them to But no! Instead, they're sent to Losing the www. prefix means that (a) a new session is generated, and the user is signed out, and (b) the security certificate becomes invalid.

I'm using Apache on a shared hosting platform (hsphere).

.htaccess file is as follows:

ErrorDocument 500 "<h2>Application error</h2>Web application failed to start properly"

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)$ index.php/$1
share|improve this question
could you show your configuration? are there any redirect rules? – Christian Jan 6 '10 at 14:17
No redirect rules, only rewrites. I've added the .htaccess file above. – TRiG Jan 6 '10 at 14:47
The rules you posted don't perform any redirection. Can you post your configs? At least the virtualhost definition. – David Jan 6 '10 at 18:04
up vote 0 down vote accepted

I guess it is because of a UseCanonicalName directive in your Apache httpd configuration. Just set it to UseCanonical off or delete the directive.

share|improve this answer
Thanks. I'll try playing with that and see what happens. – TRiG Jan 6 '10 at 14:48

Your Answer


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.