[OT] non-www to www redirect works with a little issue



Hello list,

I have place the following in my .htaccess to redirect non-www to www redirection

`````````````
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule ^(.*) http://www.example.com/$1 [R=301]

```````````````

The redirect work well but a little hitch.
Say If I visit http://example.com/page1.html it redirect to
http://www.example.com so at the home page. Where it should
append the www before the link, but not alter the link.

What modification should I add here to make it work ?

Thanks


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
Archive: http://lists.debian.org/20120525170544.3d953a95@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: htp "301 Moved Permanently"
    ... Is it possible to redirect a web page using htp? ... Then you can code javascript or other functionality within the html ... that you are "spitting out" via htp.p to have the redirect work ...
    (comp.databases.oracle.server)
  • Re: [OT] non-www to www redirect works with a little issue
    ... The redirect work well but a little hitch. ... Where it should append the www before the link, ... So you basically want to redirect just the root and keep the subdirs... ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: natd -redirect_address
    ... >> I am trying to set up natd to redirect public ips to my private ... Steve ... >> To unsubscribe, send any mail to ...
    (freebsd-questions)
  • RE: make "make" quieter?
    ... far too late, must sleep) ... > Actually the redirect works well, esp. ... To unsubscribe, ...
    (freebsd-questions)
  • Re: how can i turn /dev/null into an MTA?
    ... it's config kept asking where to redirect the mails too... ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)