Forum Moderators: phranque

Message Too Old, No Replies

How Can You Tell the SE's Which URL To Index?

         

Allen Graves

1:27 pm on Jul 21, 2010 (gmt 0)

10+ Year Member



Hi all,

I have a CMS that creates URLs in two different formats.

Why? Not sure...but it does.

When you mouse-over a link to an article, it shows in the bottom bar as...

[mysite.com...]

However, when you click on it and get to the page, the address bar shows...

[mysite.com...]

As I study the SERPS, I notice that both types of URLs are indexed with no apparent reason as to why Google chose one over the other.

So my question is, is there a way to get all of my URLs to be indexed with the SEF URL?

Can I do it with htaccess or something?

My guess is that more pages will end up higher in the SERPS if the SEF URL is used/indexed by the SEs.

Any ideas?

Allen

phranque

2:31 pm on Jul 21, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



if you check your response headers for the http://www.example.com/article/the-article-title.html request and you will see that you are getting a redirect (301 or 302 HTTP status response code) to the http://www.example.com/articledetail.php?12345 url.
this should be an internal rewrite.
this could be some incorrect mod_rewrite directives in your .htaccess or apache config or it could be done in a script that the urls are rewritten to.
your http://www.example.com/articledetail.php?12345 urls should be 301 redirected to your http://www.example.com/article/the-article-title.html urls.
also you should make sure that all your internal links and navigation use the canonical urls (http://www.example.com/article/the-article-title.html)

Oimachi2

10:11 am on Jul 29, 2010 (gmt 0)

10+ Year Member Top Contributors Of The Month



Try putting this into your .htaccess file

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^yoursite.com [nc]
rewriterule ^(.*)$ [yoursite.com...] [r=301,nc]

phranque

10:47 am on Jul 29, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



that rewrite code will help to canonicalize the domain but it won't solve the problem with query string versus directory-and-title-slug urls.

Allen Graves

2:58 pm on Aug 2, 2010 (gmt 0)

10+ Year Member



thanks, though!