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

I have this line in my .htaccess

RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{HTTP_HOST} !^ [NC] 
RewriteRule (.*)$ [R=301,L]

When i do the request, it's doing the redirection OK from one PC but from another one no. Any idea what can be the problem?



share|improve this question
You mean from one client PC it works, but from a different client PC is not? Turn on the rewrite log, and post the output. – Steven Mar 3 '11 at 15:45
up vote 0 down vote accepted

Check that you rewrite module is activated on the second box, some distro ship with that module disabled by default. On debian-based distros you can use a2enmod rewrite to enable it, don't forget to restart apache after that.

share|improve this answer
Ubuntu also has .htaccess files turned off and you need to add AllowOverride All to you apache2.conf file. – Scott Keck-Warren Mar 3 '11 at 23:54

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.