On Aug 7, 7:39 am, Peter Cooper <
pcoo...@gmail.com> wrote:
> How do other Passenger users deal with removing or adding "www" to
> their URLs without using mod_rewrite?
>
> For example, if I have a sitehttp://
www.example.com/, I might want
> all visitors tohttp://
example.com/to redirect tohttp://
www.example.com/
> (or vice versa). This is recommended for SEO purposes to help prevent
> duplicate content being detected. Normally you'd use a rewrite rule
> with a host-based condition to deal with this, but is there a way of
> doing it without activating mod_rewrite?
>
> I could always activate mod_rewrite and deal with it the classic way,
> but since it's hinted that this isn't a Good Thing (tm) to do, I'd
> like to avoid doing that.
Just to add in case it's useful for someone else, a few people have
suggested on Twitter having two virtual hosts, one for www and one
without, and then using a simple Redirect on one. That's not
acceptable in my case as I'm using cPanel and don't want to mess with
the VirtualHosts if I can avoid it (in which case mod_rewrite
reactivation is a better option).
Pete