URL rewriting causing problems
-
Hi
I am having problems with my URL rewriting to create seo friendly / user friendly URL's. I hope you follow me as I try to explain what is happening...
Since the creation of my rewrite rule I am getting lots of errors in my SEOMOZ report and Google WMT reports due to duplicate content, titles, description etc
For example for a product detail, it takes the page and instead of a URL parameter it creates a user friendly url of
mydomain.com/games-playstation-vita-psp/B0054QAS
However in the google index there is also the following friendly URL which is the same page - which I would like to remove
domain.com/games-playstation-vita/B0054QAS
The key to the rewrite on the above URLs is the /B0054QAS appended at the end - this tells the script which product to load, the details preceeding this could be in effect rubbish
i.e. domain.com/a-load-of-rubbish/B0054QAS and it would still bring back the same page as above.
What is the best way of resolving the duplicate URLs that are currently in the google index which is causing problems
The same issue is causing a quite serious a 5XX error on one of the generated URLs
http://www.mydomain.com/retailersname/1 -
, if I click on the link the link does work - it takes you to the retailers site, but again it is the number appended at the end that is the key - the retailersname is just there for user friendly search reasons
How can I block this or remove it from the results?
Hope you are still with me and can shed some light on these issues please.
Many Thanks
-
You can write canonical tags dynamically, but you need to canonical to the product specific page. Obviously, don't canonical every details.php page down to one. It could look something like this:
$prodDesc = "games-playstation-vita";
$prodCode = "B0054QAS";
$prodURL = "http://www.mydomain.com/".prodDesc."/".prodCode;
?>
I assume that the product description and code are generated from a database, so they should be available somehow to the header.
-
This is really tough to tell from generic examples, because the first thing you need to get at is the root of why these different URLs are being crawled in the first place. If "B0054QAS" is a unique product, why is it reachable by "playstation-vita", "playstation-vita-psp", etc.? That architectural problem has to be solved first, or any canonicalization is just a band-aid.
-
How would using the canonical tag work though - because I am using URL rewriting?
For example
mydomain.com/games-playstation-vita-psp/B0054QAS
is acutally something like details.php?=B0054QAS - so how would a canonical tag work in a dynamic template like above.
Because if I placed the tag below in the details.php page then I would need this to change dynamically based on the product - how can this be done?
http://www.mydomain.com/games-playstation-vita-psp/B0054QAS/>
Or would a 301 redirect be better to achieve the above?
Many Thanks
-
To work on the duplicate problem, i think the best option is the cannonical tag. You will need to include in every page (pages you want to be the official one) inside the head tag the follow:
where ww.example.com/index.html is your page adress.
Than, to block old pages that you don't want to be at google, you can use the robots.txt file. There you will use the disallow function.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Usage of keywords in URL
Hi everyone, I'm trying to optimize our website and I'm not sure what's ideal for our URL structure. We have two products: one of them is focused on B2C & the other one on B2B.
Technical SEO | | Klouwers
Our homepage is focused on the B2C product. For our B2B product, I'm not sure what's ideal. The URL for our 'homepage' of the B2B product is ourdomain.com/software. We have different target groups for our B2B software, and therefore different pages on our website. Which URL would be best to use for the keyword personal trainer software?
1. ourdomain.com/software/personal-trainer-software
2. ourdomain.com/software/personal-trainer0 -
Parked former company's url on top of my existing url and that URL is showing in SERPs for my top keywords
I have the URL from my former company parked on top of my existing URL. My top keywords are showing up with the old URL attached to the metadsecription of my existing URL. It was supposed to be 301 redirected instead of parked but my web developer insists this was the right way to do it and it will work itself out after google indexes the old URL out of existence. Are there any other options?
Technical SEO | | Joelabarre0 -
Single URL not indexed
Hi everyone! Some days ago, I noticed that one of our URLs (http://www.access.de/karriereplanung/webinare) is no longer in the Google index. We never had any form of penalty, link warning etc. Our traffic by Google is constantly growing every month. This single page does not have an external link pointing to it - only internal links. The page has been indexed all the time. The HTTP status code is 200, there is no noindex or something in the code. I submitted the URL on GWMT to let Google send it to the index. It was crawled successfully by Google, sent to the index 5 days ago - nothing happened, still not indexed. Do you have any suggestions why this page is no longer indexed? It is well linked internally and one click away from the home page. There is still the PR of 5 showing, I always thought that pages with PR are indexed.......
Technical SEO | | accessKellyOCG0 -
Changed URL of all web pages to a new updated one - Keywords still pick the old URL
A month ago we updated our website and with that we created new URLs for each page. Under "On-Page", the keywords we put to check ranking on are still giving information on the old urls of our websites. Slowly, some new URLs are popping up. I'm wondering if there's a way I can manually make the keywords feedback information from the new urls.
Technical SEO | | Champions0 -
Google Rewriting PDF Titles
Has anyone else noticed Google rewriting the title of PDF documents?
Technical SEO | | waynekolenchuk0 -
Problem with duplicate content
Hi, My problem is this: SEOmoz tells me I have duplicate content because it is picking up my index page in three different ways: http://www.web-writer-articles.co.uk http://www.web-writer-articles.co.uk/ and http://www.web-writer-articles.co.uk/index.php Can someone give me some advice as to how I can deal with this issue? thank you for your time, louandel15
Technical SEO | | louandel150 -
Should me URLs be uppercase or lowercase
I'm in the middle of doing a bunch of 301 redirects for me site. Should I make them Lowercase, uppercase, or does it matter? Also, do I want to be using hyphens (-), or underscores (_)? Any other tips? EX: http://www.stupid.com/golf-slippers.html OR http://www.stupid.com/Golf-Slippers.html
Technical SEO | | JustinStupid0 -
Should I not Change the URL of Ranking Pages
My site currently ranks #1 or #2 for 2 separate pages on web design & SEO for my geographic location. The URLs are currently mysite.com/services/web-design/ and mysite.com/services/seo/ I'm redesigning my site and I'm taking out the "Services" page as I'm focusing on web design and SEO and lumping everything else into my "Internet Marketing" page. Because my pages for web design and SEO rank so well, should I keep the URL structure even though I don't have a "Services" page or should I just remove services and 301 redirect so I have mysite.com/web-design/ and mysite.com/seo/. I know doing a 301 redirect could hurt me in the short term but I'm wondering if I should just bite the bullet now and change it in favor of a better URL structure. What do you think?
Technical SEO | | JaredDetroit0