PDA

View Full Version : Redirect non-www to www using .htaccess


Guest20210129
02-08-2011, 01:13 PM
Hi all!

I've a doubt: I'm trying that when everyone type vidaelectronica.com (which is my wp) would be redirected to www.vidaelectronica.com

I've done this with this code:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^vidaelectronica.com$
RewriteRule ^(.*)$ "http\:\/\/www\.vidaelectronica\.com\/$1" [R=301,L]

By the way, i'm also trying that ALL adresses without www would be redirected to a www adress, but i don't know how to do it. I'm meaning to this:
vidaelectronica.com/forum/x/xx-x-x-x-xxx.html to www.vidaelectronica.com/forum/x/xx-x-x-x-xxx.html

How can I do that? Thanks! :)

NoPretender
02-08-2011, 01:32 PM
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.vidaelectronica\.com
RewriteRule (.*) http://www.vidaelectronica.com/$1 [R=301,L]

Guest20210129
02-08-2011, 04:11 PM
Thanks, but it doesn't work. Only redirects the main

I'm putting the .htaccess in the root of the domain, can be it the problem?

arthur62
03-20-2011, 07:29 AM
hello I would like to make a redirect??
Let me explain

I have a forum with link: http://www.arcade-entre-amis.be/forum.php

I bought some link OVH

it works fine but I would change
donq I bought a new link (domain name)
OVH
and that (www.chez-belge.be)
I would like the link is http://www.arcade-entre-amis.be/forum.php Deriger to the www.chez-belge.be how I can do without having that problem and nothing has changed my forum?? can you help me I'm terrible in there thank you in advance to you

if possible a tutorial with everything in