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:
http://www.w3schools.com/html/tryit.asp?filen
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 wrote:
> Hello,
>
> I have place the following in my .htaccess to redirect non-www to www
> redirection
>
> `
> R
when in fact you 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 wr
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
DocumentRoot /www/sitea
ServerName www.sitea.com
ErrorLog
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
documen