Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I have an ubuntu apache serveur, with many websites. all my website have the same bug ( so it's look like a misconfiguration) <- it's work fine ( we see "en travaux") <- dont work, i got 310 error (cyclic redirection!)

here my .htaccess

Options +FollowSymlinks
RewriteEngine on
RewriteCond  %{HTTP_HOST}      ^2sigma\.fr$
RewriteRule  ^(.*)   $1      [R=301,L]

here my confguration

<VirtualHost *:80>
<IfModule mpm_itk_module>
AssignUserId sigma www-data

    DocumentRoot /home/sigma/www
    <Directory />
            Options FollowSymLinks
            AllowOverride All
    <Directory /home/sigma/www>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
    ErrorLog /var/log/apache2/error_sigma
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn
     CustomLog /var/log/apache2/access_sigma combined
    ServerSignature Off

If i use this .htaccess it's work fine :

Options +FollowSymlinks
RewriteEngine on
RewriteCond  %{HTTP_HOST}      ^2sigma\.fr$
RewriteRule  ^(.*)   $1      [R=301,L]

I think that it is a apache configuration probleme... but i dont kno how to solve it.

Thanks for your help

share|improve this question

Try this in your .htaccess:

  RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
  RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
share|improve this answer
Hi,thanks for the help but it dont work. both and show the index.html without any rewriting – allstat May 30 '12 at 16:24
it's look like the rewritecond %{HTTP_HOST} !^www\..+$ [NC] dont match.. – allstat May 30 '12 at 16:26
Did you restart apache to ensure it took effect? – thinice May 30 '12 at 16:30
yes... but no effect. – allstat May 30 '12 at 17:09
Are you sure there's not other outside influences? You might want to (very briefly) enable debug output to your logs to track the rules being parsed. – thinice May 30 '12 at 21:37

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.