SEO Services
Home >>
Webmaster Forums >>
SEO-ing your WeblogSEO-ing your Weblog
Darren said: "Quinny has a common problem which will fix quick, before it gets to be a big deal.
In Google, you will be destroyed if you don't 301 your non-www to your www. What this means simply is: [url]http://savaege.com/blog/[/url] should automatically redirect to [url]http://www.savaege.com/blog/[/url]. If both versions exists, and are linked from externally, your Google nightmare will begin.
I can explain how to do this in detail, if you want."
quinny said: "go ahead......"
Darren said: "Do you have access to .htaccess ? If this is a Linux server probably.
First, decide on which one to use. I suggest the www. version, because it's more widely used. Add this to your .htaccess file. Make sure you have a backup, in case your site goes "blank".
[code]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^web-mastery\.net
RewriteRule (.*) http://www.web-mastery.net/$1 [R=301,L]
[/code]
Put this at the beginning of .htaccess
This assumes 2 requirements are met:
1) The host has "AllowOverrides" set in httpd.conf
2) Mod-Rewrite is installed
If this is a Linux setup, all should be well. The way you can confirm it works is by typing the domain without the www. in. You will see it automatically redirect and remain as www. in your browser address bar."
quinny said: "did that... doesn't seem to be working..."
Darren said: "You changed it to your domain, obviously?
It looks like you have mod_rewrite running so that code should work.
I bet I know what happened? You did this in the Blog sub-directory and not the root directory. Do this in the root directory, it affects all requests to the domain and not just the Blog."
quinny said: "yes i guessed that it would be my own domain ...lol
and no it's in the root I did it...."
Darren said: "Try adding this above all other lines:
[code]
[FONT=verdana][SIZE=2][COLOR=#000000]Options +FollowSymlinks
[/code]
[/COLOR][/SIZE][/FONT]"
Darren said: "[code]
RewriteCond %{HTTP_HOST} !^www\.saveage.com\.com
rewriterule (.*) http://www.saveage.com/$1 [R=permanent,L]
[/code]
You can try this slight variation also."
Darren said: "Also, make sure the file is world-readable. chmod go+r or chmod 644 should work."
quinny said: "will try above..."
Darren said: "Should work. If not, it's probably "AllowOverride" is set to off."
quinny said: "still the same"
Darren said: "Is the host pretty responsive?
First try this:
[code]
[FONT=verdana][SIZE=2][COLOR=#000000]RewriteEngine On
RewriteRule ^test\.html$ http://saveage.com/index.php [R=[B]301[/B],L]
[/code]
Then type saveage.com/test.html in and see if you're redirected to the index.php file. If not, the host needs to fix one of two things:
1) In httpd.conf set AllowOverride for you
2) [/COLOR][/SIZE][/FONT][FONT=verdana][SIZE=2][COLOR=#000000]AccessFileName points to a file with a name other than .htaccess (doubtful)
If the rewrite command above works, it's something else to be checked.
[/COLOR][/SIZE][/FONT]"
Darren said: "You can also try CHMOD 666 and see if it makes a difference."
quinny said: "could not be found"
Darren said: "Check with the host. Something is turned off. It should be a very easy fix, since Mod-Rewrite is already installed."
quinny said: "sent them an email..."
Darren said: "I'm sure they'll sort it no problem. That's the major SEO issue we'll face, so once it's out of the way, we can move on."
quinny said: "did what you said again a different way and your first option you gave an internal error came up..."
Darren said: "That just means the code is altogether wrong or broken. See what the host says, they'll fix it quick I'm sure."
quinny said: "ok using this in the root
[CODE]RewriteEngine On
RewriteCond %{HTTP_HOST} ^savaege.com$
RewriteRule (.*) http://www.savaege.com/$1 [R=301,L][/CODE]
redirects savaege.com to [url]www.savaege.com[/url]
but savaege.com/blog doesn't seem to be redirecting?"
chris3471 said: "You can change it in the wordpress options, change it from [url]http://savaege.com/blog[/url] to [url]http://www.savaege.com/blog[/url] I had to do that too."
Darren said: "Okay, you're having the same problem as Chris.
Post the contents of the .htaccess file you have in the sub-directory, please."
chris3471 said: "I'll post mine too.
*edit* ok here it is.
# BEGIN WordPress
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
# END WordPress"
quinny said: "[CODE]# BEGIN WordPress
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php
# END WordPress[/CODE]"
Darren said: "Try this.
Put the name of the subdirectory in the .htaccess of the main root directory as an exclusion.
[code]
RewriteRule ^(yourblog) [/code]
Replace yourblog with the name of Your Blog and put it in the main .htaccess."
quinny said: "getting an internal error"
Darren said: "Oops, incomplete line
[code]
RewriteCond %{REQUEST_URI} ^/(cgi-bin|blog)/?.*$ [NC]
[/code]
Try that. This goes in the root .htaccess and tells it to ignore your Blog directory."
quinny said: "still the same as before...."
chris3471 said: "That didn't work either, didn't get the error that time though."
Darren said: "Alright, I solved this! I had this happening on Cleveland Ohio Funguide.
Put this as first lines in the .htaccess located in the blog directory
[code]
RewriteEngine On
RewriteBase /cleveland-weblog/
RewriteCond %{HTTP_HOST} !^www\.cleveland-ohio-funguide\.com
rewriterule (.*) http://www.cleveland-ohio-funguide.com/cleveland-weblog/$1 [R=permanent,L]
[/code]"
quinny said: "thats the job... good man yourself!!!"
chris3471 said: "I assume we change it to our urls, lol."
quinny said: "....eh ya... lol"
Darren said: "[quote=chris3471]I assume we change it to our urls, lol.[/quote]
You got it. Okay, I didn't even notice this was happening on my own blog, so I'm glad we got this sorted. This will save us a ton of grief down the road, and now it doesn't matter how people link because it all get's consolidated into one :)"
quinny said: "yay for us!!!!"
chris3471 said: "I have a small problem with mine, it changed to this: (I put it in brackets so it wouldn't shorten the url)
Here's the code
[code]
RewriteEngine On
RewriteBase /blog/
RewriteCond %{HTTP_HOST} !^www\.bloggeries\.com
rewriterule (.*) http://www.bloggeries.com/blog/$1 [R=permanent,L]
[/code]"
Darren said: "Heck yeah. It's been a good week so far.
I plan on writing more lists. I may even hit the "forum circuit" a bit with the Blog in my sig file to trawl in related webmasters. That way, they'll link to the listed articles.
I'm sure the linkage is starting to add up, and we should see the newer blogs getting into the search engines next week, and maybe even sooner.
That's why we need to Title our threads as carefully as possible. Try to make it interesting so that a reader would click, and keep in mind you'll rank at the top of Technorati for the keyword for awhile because of freshness. Put a big word in there, so you have some chance for immediate traffic. The traffic will likely be webmasters who need to find new content to link to. Since we have no users of our own, every incoming links gives us a chance to convert users."
quinny said: "works fine for me"
Darren said: "Alright Chris, it redirects okay at the main site, but in the subdirectory it replaces the URL with the local file path?"
chris3471 said: "yep I think that's what it's doing."
Darren said: "Looks like it's working to me Chris! :)"
quinny said: "i see whats happening
bloggeries.com/blog/ is redirecting but bloggeries.com/blog isn't"
quinny said: "mines the same..."
chris3471 said: "Oh yeah, it only does it if you don't add the /"
chris3471 said: "*waits patiently for a reply*"
quinny said: "yeah... god he's as slow :rolleyes: :D"
chris3471 said: "I see it turns up a 404 as well."
Darren said: "The solution, of course, is to add this after the other lines I gave you :)
[code]
RewriteRule ^cleveland-weblog$ /cleveland-weblog/ [QSA,L][/code]"
quinny said: "[QUOTE=quinny]mines the same...[/QUOTE]
it does..."
chris3471 said: "Solution it is not says Yoda, it seems the force is not with you Bk Skywalker. Didn't work."
quinny said: "nope not here either"
Darren said: "[url]http://www.bloggeries.com/blog/category/bloggeries[/url]
Page is there for me."
chris3471 said: "Try this though turns up a 404
[url]http://bloggeries.com/blog[/url]"
Darren said: "Oh okay, just on that one root page. Let me see what I can do."
chris3471 said: "Oh yeah, just that one page."
chris3471 said: "I've lost all my incoming links as well."
quinny said: "that happened to me too but they have come back again"
chris3471 said: "Well aren't you lucky. Hey it's the luck of the Irish. :D"
quinny said: "they always come back to me :D"
quinny said: "oh well this is going to have to wait... i'm heading off out!"
Darren said: "Okay, have a good one.
[code]
RewriteRule ^/*(.+/)?([^.]*[^/])$ [URL="http://www.webmasterworld.com/rd.cgi?f=92&d=5253&url=http://%%7BHTTP_HOST%7D/$1$2/"]http://%{HTTP_HOST}/blog/$1$2/[/URL] [L,R=301] [/code]
That's the fix. Make sure it's all on one line above the others in the Blog directory."
chris3471 said: "Yep that did the trick. :D"
Darren said: "Yeah. I triple-checked it, and saw no problem. I'll probably look around for a WordPress plugin that does Meta tags, because it's really not a bad thing to have.
I am very happy we got the 301s setup correct, right at the beginning! The crawlers will have no problem doing their jobs no matter how people link now."
chris3471 said: "Great now I shouldn't see duplicate links removed at Technorati."
Darren said: "Exactly, and I discovered a final flaw: the www. without trailing slash was 404.
Here is the fix:
[code]
RewriteRule ^home/funguide/cleveland-weblog /cleveland-weblog/ [R=301,L][/code]
Add that to the other lines. So to recap for those playing at home:
[code]
RewriteEngine On
RewriteBase /cleveland-weblog/
RewriteRule ^/*(.+/)?([^.]*[^/])$ http://%{HTTP_HOST}/cleveland-weblog/$1$2/ [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.cleveland-ohio-funguide\.com
rewriterule (.*) http://www.cleveland-ohio-funguide.com/cleveland-weblog/$1 [R=permanent,L]
RewriteRule ^home/funguide/cleveland-weblog /cleveland-weblog/ [R=301,L]
[/code]
That is the complete code that should consolidate all of the URIs into one."
chris3471 said: "I'm not getting that 404"
chris3471 said: "Oh, yes I am, I'm not getting a 404 but it's redirecting to the directory homepage.:eek: :eek:"
chris3471 said: "So for me that would be this right?
RewriteRule ^home/blogger/public_html/blog /blog/ [R=301,L]"
chris3471 said: "Yet another problem,
[url]http://www.bloggeries.com/blog/category/bloggeries/[/url] is ok
[url]http://www.bloggeries.com/blog/category/bloggeries[/url] is not"
Darren said: "The second one is missing the directory "blog" in it somewhere."
chris3471 said: "exactly, now what?
Here's what I've got so far
# BEGIN WordPress
RewriteRule ^/*(.+/)?([^.]*[^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301]
RewriteEngine On
RewriteBase /blog/
RewriteCond %{HTTP_HOST} !^www\.bloggeries\.com
Rewriterule (.*) http://www.bloggeries.com/blog/$1 [R=permanent,L]
RewriteRule ^home/blogger/public_html/blog /blog/ [R=301,L]
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
# END WordPress"
Darren said: "Try this instead:
[code]
# BEGIN WordPress
RewriteEngine On
RewriteBase /blog/
RewriteRule ^/*(.+/)?([^.]*[^/])$ http://%{HTTP_HOST}/blog/$1$2/ [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.bloggeries\.com
Rewriterule (.*) http://www.bloggeries.com/blog/$1 [R=permanent,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
# END WordPress
[/code]"
chris3471 said: "Same thing"
Darren said: "Okay, Chris, replace it with the corrected one above and report back. Re-paste it in or just add the word /blog/ where I did on the 5th line down.
Then we'll add the last rule."
chris3471 said: "I think we have a winner."
Darren said: "Okay, one last line to finish the job.
[code]
RewriteRule ^home/blogger/public_html/blog /blog/ [R=301,L]
[/code]
Add it before the Request-File line."
chris3471 said: "Done, it seems to be ok. So do you think that's why I was having to hard code all my images starting with http:// ?"
Darren said: "I'm not sure I understand the question."
chris3471 said: "My image links won't work as /images/someimage.gif
but will as [url]http://www.bloggeries.com/blog/images/someimage.gif[/url]"
Darren said: "Yeah, it's because of mod_rewrite. It's probably safer to use the full path anyway."
chris3471 said: "Oh ok, I haven't tried it yet since we finished so it may work now anyway."
Darren said: "Also, make sure you make a backup of your current config, especially the .htaccess now that it's up and running."
chris3471 said: "All backed up, I did the main .htaccess and the one for the blog."
quinny said: "ok... so whats the update since thursday... tryed a few things but not working right"
Darren said: "Did you contact your webhost, what did they say?"
quinny said: "[QUOTE=host man]Hello,
I looked at the scripted that you had in htaccess and on this line you had a /.com for the domain name instead of a .com$ I got that changed for you and it is working now.
RewriteCond %{HTTP_HOST} ^[url]www.savaege./com[/url]
Changed to:
RewriteCond %{HTTP_HOST} ^www.savaege.com$
If you have any more problems let me know.
[/QUOTE]
that seemed to work....
the problem how is with savaege.com/blog not working
while savaege.com/blog/ is ....you know yourself"
Darren said: "Try adding this line first in the blog .htaccess
[code]
RewriteRule ^/*(.+/)?([^.]*[^/])$ http://%{HTTP_HOST}/blog/$1$2/ [L,R=301][/code]"
Darren said: "And after that add this:
[code]
RewriteRule ^home/savaegec/public_html/blog /blog/ [R=301,L]
[/code]
And now you'll be all set."
quinny said: "all looks good now!"
Darren said: "[quote=quinny]all looks good now![/quote]
That's excellent news. With that out of the way, the rest is easy."
chris3471 said: "[QUOTE=quinny]all looks good now![/QUOTE]
Now you just need a nice custom header.;)"
Darren said: "Yeah, that's what you need now. Who made yours at the Bloggeries, Chris?"
chris3471 said: "Jamey had his sister make it so it would match the one in the directory."
Darren said: "Nice. It came out very good."
chris3471 said: "Thanks :D :D"
Darren said: "Look, [url=http://www.google.co.uk/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial_s&hl=en&q=film+production+dublin+blog&meta=&btnG=Google+Search]quinny has google search traffic[/url]"