What I’m trying to do is to redirect my website visitors who enter example.com to http://www.example.com.
I would do this with a standard redirect, but I don’t know how to make a site specific to WWW or non-WWW addresses.
I see that Firefox thinks my site is clearly different at the WWW version, because it reloads it without using the cache. How can I make a non-WWW specific index.html page to redirect them to http://www.example.com?
Try this mod_rewrite example:
This will append
www.to every request that’s host does not start withwww.and redirect to it with a permanent redirect. The URI protocol is also preserved but you might want to add a condition to only redirect specific request methods (like GET and HEAD).