There are a few ways. You can use an Apache redirect documented here:
http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect
or Apache RewriteRule:
http://httpd.apache.org/docs/2.2/rewrite/
or you can add an HTML redirect to your index.html:
This works for us.
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule .* http://www.example.com%{REQUEST_URI} [R=301,L]
On Fri, May 25, 2012 at 6:53 AM, J. Bakshi joyd...@infoservices.in wrote:
Hello,
I have place the following in my .htaccess to redirect non-www to www
redirection
are
using the default vhost.
I tend to define a defunct vhost first - one with nothing in the
documentroot, except an error document which is served in response to every
URI. This makes errors less puzzling.
On 12 January 2012 21:21, Clay Porter clay.por...@gmail.com wrote:
All,
I have two
All,
I have two virtual hosts set up that look like the following (I've
tried to only include the information pertaining to the problem, i,e,
I've removed the actual rewrite rules, etc):
Listen *:38215
NameVirtualHost *:38215
VirtualHost *:38215
DocumentRoot /www/sitea
ServerName
I am trying to set up rewrite rules so that when users access certain
pages via HTTP they are redirected to HTTPS. Conversely, if they
access pages that do not require security I want the user to be
redirected from HTTPS to HTTP.
I have looked at numerous examples and read the rewrite rule