andrew anderson
andrew anderson

Reputation: 393

SEO friendly urls to avoid duplicate content

I have nearly completed my .htaccess file now so that my urls all work properly. However i have a quick question:

I have a rewirte that looks like this :

    RewriteRule ^fishing/([^/]*)/?$ region.php?region=$1 [L]  

This works in that if i type in fishing/fife/ it loads the region.php file. However what i didnt know nor expect was that if i type in region.php?region=fife then this also works.

I believe that this will give me duplicated content and my SEO rating will be effected. How do i make is so that if i type in region.php?region=fife that it automatically changes to fishing/fife/ ????

Upvotes: 1

Views: 1112

Answers (2)

John Conde
John Conde

Reputation: 219924

The better solution to this is canonical URLs. This tells the search engines which URL is the one you want to show in the search results and that all other URLs that reach that page is a duplicate of it and to count it towards that [page's rankings (that includes incoming links).

You should not just hope the search engines don't find that other page. If they do that's duplicate content and obviously something you should be avoiding.

Upvotes: 1

Matt Mombrea
Matt Mombrea

Reputation: 6831

As long as you don't link to the Non-rewrite URL structure (i.e. region.php?region=fife) then there will be no way for webcrawlers to discover that URL and you won't get duplicate content.

If a human were to type in that URL and get the result, that is OK as far as SEO is concerned.

So just be sure to only use the pretty URL structure in your app.

Upvotes: 0

Related Questions