[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Apache 2.2 rewrite rule help needed



Hi All,

Running Apache 2.2 on Debian testing and having no luck getting a
rewrite rule to work. Straight out of the rewrite guide I am trying the
following to force the domain name to always be displayed as
www.domain.com even when it is accessed as domain.com.

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://www.domain.com/$1 [L,R]

I have tried many variations of this rule in both the apache virtual
configuration as well as an .htaccess file. I have verified via a dump
of the modules loaded that the rewrite module is loaded. The Options
FollowSymLinks is set and AllowOverride is set to FileInfo. I know the
.htaccess file is being read because I can put trash in it and it will
result in an Internal Server Error. Once the garbage is removed I can
load the web page without error. The rewrite rule never has an effect
and never gives any errors. Ideas?

Thanks,

Jim



Reply to: