PDA

View Full Version : redirect http:// to http://www



marco212
12-29-2007, 05:43 PM
Hello,

my addon site is loading either with http://mysite.com or http://www.mysite.com.
i want it only to load as http://www.mysite.com
i tried a redirect, but it did'nt work out.
any idea?

i am using joomla cms with .htacess

Depeche
12-29-2007, 08:05 PM
How many domains are involved? Your add on domain should work as http://mysite.com or http://www.mysite.com. Both work. I do not really understand what you are trying to ask.

marco212
12-29-2007, 08:11 PM
if someone types http://site.com , i want it to be redirected as http://www.site.com.
now, it displays http://site.com or http://www.site.com, what is a big waste for seo.(search engines sees it like 2 different sites)

linFox
12-29-2007, 08:44 PM
This should do it (modify for your domain then put it in .htaccess), although I haven't used this bit of code in a long time and so I can't be overly sure if it causes any problems:


RewriteEngine On
# URL Cleaning
RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,NC,L]

Hot DesignZ
12-31-2007, 02:32 PM
if someone types http://site.com , i want it to be redirected as http://www.site.com.
now, it displays http://site.com or http://www.site.com, what is a big waste for seo.(search engines sees it like 2 different sites)

Really? I have not heard that. huh I thought the best thing was make sure that www. redirects to no www. since www. is now 100% pointless

marco212
01-03-2008, 09:00 PM
The redirect did'nt work out, i did try many things , i got a message that the page doesn't redirect properly, strange.
I will try with cgi and ruby later.... (would be better with htacces , then i am using it for url rewriting)
Trouble is that many people point to www.site .... so google may give more pr on www.site than http://site ... here is my concern.