?
Solved

Redirect Query String URLs for SEO

Posted on 2012-08-29
14
Medium Priority
?
935 Views
Last Modified: 2012-09-23
I have a SEO related question. In Google Webmaster Tools - HTML Improvements, I have some duplicate title issues. Here are the listed problems:

Love Astrology: A guide to romance and love through astrology.
/astrology/love-astrology.htm
/astrology/love-astrology.htm?ref=s0d.org

10 Romantic Ideas for Music Lovers
/top-10/romantic-ideas-for-music-lovers.htm
/top-10/romantic-ideas-for-music-lovers.htm?asid=33f97801

Romantic Ideas for Long Distance Relationships
/dating/long-distance-relationships.htm
/dating/long-distance-relationships.htm?iframe=true&width=100%25&height=100%25

I Love You
/i-love-you.htm
/i-love-you.htm?iframe=true&width=100%&height=100%

These issues seem to be related to query strings that we don't use. I am wondering how best to deal with these issues. Should I set up .htaccess redirects for each of the query strings: ref, asid, and iframe? It seems like it would be better if I could somehow tell the server to just not redirect query strings that I set up to use and redirect all others. Is there a way to do this?
0
Comment
Question by:webstuck5
14 Comments
 
LVL 10

Expert Comment

by:Gregg
ID: 38348619
Id suggest using a rewrite condition to detect the query string values and redirect (permanently) to the correct page.

Take a look at SO post for example.

I hope this helps.
0
 

Author Comment

by:webstuck5
ID: 38348659
Is there a way to just say redirect all query strings except for whichever ones I may be using?
0
 
LVL 23

Expert Comment

by:Tony McCreath
ID: 38349199
Google Webmaster Tools has a section where you can tell them to ignore certain parameters:

Configuration->URL Parameters
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:mcnute
ID: 38349426
Maybe this is what you're searching for. This deletes the query string off the page.

This code goes in your .htaccess file in your root directory:

RewriteEngine On
RewriteRule ^page\.php$ /page.php? [L]

Open in new window

0
 

Author Comment

by:webstuck5
ID: 38366413
I'd rather not do it within Google Webmaster Tools because that doesn't do anything for the other search engines. I also don't like the idea of just deleting the query string because I may want to use a query string at some point. Is there no way to just redirect all query strings except for ones I specify?
0
 
LVL 23

Expert Comment

by:Tony McCreath
ID: 38366763
Do those parameters have a use? If so you will break things if you redirect. If not, redirecting will work for you.

If you use Analytics campaign tracking or AdWords then be very careful about what parameters cause redirects and that you don't remove other parameters in the process. Otherwise you will break the tracking code those systems use.

Another solution is to implement the canonical tag on those pages. This lets you specify the exact URL you want to be indexed (e.g. without the parameters). You don't need to do redirects and run the risk of breaking other things.
0
 

Author Comment

by:webstuck5
ID: 38385335
How would I implement canonical tags on just the pages with query strings?
0
 
LVL 23

Expert Comment

by:Tony McCreath
ID: 38385412
You can place the canonical tag on all pages. How you do it is down to how your website is built.
0
 

Author Comment

by:webstuck5
ID: 38389559
There are no actual page files with query strings so how would I put a canonical tag on those pages.
0
 
LVL 23

Expert Comment

by:Tony McCreath
ID: 38389649
The query string does not change the page requested unless you are using the query string to create dynamic content. so these are the same page

/top-10/romantic-ideas-for-music-lovers.htm
/top-10/romantic-ideas-for-music-lovers.htm?asid=33f97801

Adding a canonical tag to the first should also add it to the second.
0
 

Author Comment

by:webstuck5
ID: 38392557
I want the none query string URL indexed. Are you saying that I should have a canonical tag on /top-10/romantic-ideas-for-music-lovers.htm pointing to itself?
0
 
LVL 23

Expert Comment

by:Tony McCreath
ID: 38393309
That's fine. Not necessary but not an issue either.

It can actually help out in other duplicate issues like https URLs or different case URLs
0
 

Author Comment

by:webstuck5
ID: 38393716
The problem is that Google seems to see a URL without a query string and the same URL with a query string as having duplicate titles. So, I'm not really sure how to fix it. It seems odd for me to put a canonical tag on a url to point to itself to handle the url if a query string is added to it.
0
 
LVL 23

Accepted Solution

by:
Tony McCreath earned 2000 total points
ID: 38393982
You could do some special code to remove the tag if there is no query string. It makes no difference though. A self referencing canonical tag is not a problem and just gets ignored.

What will fix your problem is the tag on the URLs with the query string that will tell Google the canonical version does not have a query string.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whoever said that “a picture is worth one thousand words” observed a fact that can dramatically affect your marketing success. Most people tend to learn visually, so many publishers commonly acknowledge the effectiveness of visual learning by using…
Strategic internal linking is often considered an SEO power technique, especially for content marketing. Do you need to hire an SEO agency to optimize you internal linking? No, this article will help you understand the basics of internal linking and…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.
Suggested Courses
Course of the Month13 days, 22 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question