Problem with www and http

parasitus84

Regular Member
Joined
Apr 28, 2011
Messages
288
Reaction score
42
When backlinking my new website I was making sure that I pick one domain and I picked the root domain: hxxp://site.com. Everything was fine till I got one service from this forum and the guy used wrong details for it (hxxp://www.site.com). Since then everytime I put the address in the address bar the name automatically changes to www.site.com and then back to site.com. Can this influence my SEO and if yes should I redirect those links somehow?

Thanks!
 
Just fix your .htaccess file

Code:
RewriteEngine On
RewriteBase /

# Rewrite www.domain.com -> domain.com 
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com [NC]
RewriteRule (.*) http://example-domain-please-change.com/$1 [R=301,L]
#
# or for the opposite domain.com -> www.domain.com use the following
# DO NOT USE BOTH
#
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
#RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

Don't worry about the links, it's good now for diversification. Just change the domain add to .htaccess problem solved.
 
Thanks so much guys! I'm getting a little bit mixed-up with replacing the links (http and www) in the example given above. Do I have to use http:// at all?
 
Thanks so much guys! I'm getting a little bit mixed-up with replacing the links (http and www) in the example given above.

Very simple, don't get confuse. Don't replace any link or change anything. Just update your .htaccess file in your host with this few lines. Of course change the domain for yours. And that's it. When you type www.yoursite.com it will redirect to yoursite.com. All the links you generated are ok and won't loose any value.

If you don't know what to do with the .htaccess file, just talk to your host support department. They will help you very quickly.

Now if you are using WP as your engine just change on your settings your site url and use http://yoursite.com it will update your .htaccess for you.
 
Last edited:
Would this be ok?


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

I'm getting confused with the special characters like $ etc.

I also have this in my .htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Do I delete this?

Thanks!
 
Last edited:
Would this be ok?




I'm getting confused with the special characters like $ etc.

I also have this in my .htaccess:



Do I delete this?

Thanks!

Just go to wordpress >> settings >> general

under WordPress URL and Site URL make them http://mybestdomain.com both of the fields and click save. WP will update this directly for you. No other setting needed.
 
Looks like the code should be OK. And this shouldn't really impact your SEO - google deals with this crap all the time. I mean, it's not optimal, but I wouldn't expect to be slapped or something because of it. It is however, bad for user experience.
 
Just go to wordpress >> settings >> general

under WordPress URL and Site URL make them http://mybestdomain.com both of the fields and click save. WP will update this directly for you. No other setting needed.

I've never changed them and both of them have always been http://mybestdomain.com.

Do I still need the .htaccess code then?
Thanks!
 
Send me a PM with your URL if you don't mind I'll take a quick look. You might not need it, you might be using all in one and could be doing a redirect.
 
If the content is the same on both domains, it makes no difference. Google is excellent at understanding they are on in the same... That is unless you are serving up different content for www and no www.

You can also set your preference in webmaster tools.
 
Ok, many thanks, guys. Problem solved, I guess ;)
 
Back
Top