Hello, I have a question about base tag and SEO I saw many times this tag but i have no idea what is the relation with SEO Does anyine know? Cheers!
There are two articles in particular, this in reference of base tag usage: www.htmldog.com/reference/htmltags/base And this other about its implementation: http://blogs.msdn.com/ie/archive/2005/08/29/457667.aspx In SEO <BASE href = "http://www.domain.com/"> could be used as alternative to 301 redirect in those links placed between the <head> and </head> tags.
301 redirect is made adding a few lines to your .htaccess file, this way RewriteEngine on RewriteCond %{HTTP_HOST} ^your_domain.com/index.php$ [OR] RewriteCond %{HTTP_HOST} ^www.yourdomain.com/index.php$ RewriteRule ^(.*)$ http://www.yourdomain.com [R=301,L] Code (markup): in this example your are redirecting all the input which include index.php in the URL to www.yourdomain.com with no file name. 301 redirect can be used in a number of ways and it depends on your needs how to use it and what for. Some reading about it: www.tamingthebeast.net/articles3/spiders-301-redirect.htm
I want to redirect www . mydomain.com to mydomain.com I used this code: Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.mydomain\.com RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L] Code (markup): but it redirect from mydomain.com to www . mydomain.com how can i do the reverse?
You can do any of these redirections this way: Redirect www.domain.com to domain.com RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^domain.com$ [NC] RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301] Code (markup): Redirect domain.com to www.domain.com RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301] Code (markup):
Deciding which is best in every case depends on different factors: Pagerank: most sites have 2 different pagerank values, with and without www. Selecting the one with the higher rank is the most advisable. Affinity: some domains "sounds" better with www while other are more suitable without them, particularly those with info and name extension. Ask yourself how your domain name sounds better and go for it. Personal Preferences: disregard the reason, some people prefer keep using www as former display option. If you feel comfortable with your domain name either way, choose that way for redirecting.
that's great but what about Duplicated content? As you said www . my domain.com id not as mydomain.com I am talking about TOS of Adsense? Should I do anything for this?
I am not confident about <base> tag, I feel sometime it is good and sometimes it is bad for website, so be conscious with this tag
In the past there were speculations about using <base> tag, but actually it helps your site to be compliant with the Disabilities Discrimination Act. Exactly, if you want to minimize this risk, go for one or another redirect option. This way all your traffic is lead to your chosen version, including Search Engines.
Handy for dynamically generated directoriy structures - tells the browser where to find files with relative URLs such as stylesheets and javascript files. Have to be a little careful though as some clients simply dont follow the <BASE> rule. You tend to find quite a few 404 errors from mobile devices and the like.
Sorry didn't mean to confuse. After reading entire thread I can see that you want to use the .htaccess 301 redirect as advised above. Forget about <base> if all you want to do is redirect www.yoururl.com to yoururl.com.