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
-
Are my Domain URLs correctly set up?
Hi Im struggling with this probably easy concept, so I am sure one of you guys out there can answer it fairly easy! My website is over50choices.co.uk and whilst using the free tools in Majestic it said that I had: 77 Referring Domains pointing to www.over50choices.co.uk and only 35 pointing to www.over50choices.co.uk/ And in Moz it said: The URL you've entered redirects to another URL. We're showing results for www.over50choices.co.uk/ since it is likely to have more accurate link metrics. See data for over50choices.co.uk instead? Does this mean that my domains arent set up correctly and are acting as separate domains - should one be pointing to the other? Your help appreciated. Ash
Technical SEO | | AshShep10 -
URL Structure Question
We are building a job board website that will have a decent amount of "career resources" type content and want to make sure we set up our url structure correctly. After researching on Google and here I have an idea how to structure it but would like some insight if we are on the right track. We are using Wordpress for the content part of our website. We will have about 5 content categories (like resume-tips, job-interviews, job-search etc.) The two options we are considering; www.domain.com/career-resources/index.html As content start page www.domain.com/career-resources/resume-tips/index.html category start page www.domain.com/career-resources/resume-tips/top-5-resume-mistakes.html article name is the /career-resources/ folder really needed or can we go something like; www.domain.com/career-resources/index.html As content start page www.domain.com/resume-tips/index.html category start page www.domain.com/resume-tips/top-5-resume-mistakes.html article name Are we on the right track... and is one way better for SEO that the other? Thanks! Shaun
Technical SEO | | aactive0 -
Canonical: Is this a problem?
Hi!!
Technical SEO | | petrospan
I am running a small wordpress website and i have a question because i am a litle confusic about Rel Canonical notices in the crawl diagnostics! I have the seo by yoast and i have fix all the canonical url for my page, but i take notices. I must worried about it or is something that inform me that everyting is ok? rel.jpg rel.jpg0 -
Landing Page URL Structure
We are finally setting up landing pages to support our PPC campaigns. There has been some debate internally about the URL structure. Originally we were planning on URL's like: domain.com /california /florida /ny I would prefer to have the URL's for each state inside a "state" folder like: domain.com /state /california /florida /ny I like having the folders and pages for each state under a parent folder to keep the root folder as clean as possible. Having a folder or file for each state in the root will be very messy. Before you scream URL rewriting :-). Our current site is still running under Classic ASP which doesn't support URL rewriting. We have tried to use HeliconTech's ISAPI rewrite module for IIS but had to remove it because of too many configuration issues. Next year when our coding to MVC is complete we will use URL rewriting. So the question for now: Is there any advantage or disadvantage to one URL structure over the other?
Technical SEO | | briankb0 -
How do I fix these duplicate URLs?
HI guys, I ran a report on my site and it shows some duplicate titles (example below). Do I need to add something to the htaccess file or another file to fix this? I understand that the search engines should only see 1 URL for the page. 2 pages have "Bikes for sale | used bikes | second hand bicycles" title pauslwebsite.com/bikes/ paulswebsite.com/bikes/index.asp Thanks
Technical SEO | | paulmund0 -
How to change URL of RSS Feed?
Hi, There are some websites that keeps on scraping my content. I have blocked them already from accessing my website using .htaccess but they still get my content via RSS feed. I have tried delaying the RSS feed but I think this affected google rankings. My question is, is there a way to change the URL of my RSS Feed? From: http://www.mysite.com/feed to http://www.mysite.com/feed2
Technical SEO | | Trigun0 -
Canonical for non-exist URL ?
Hi I have a website what has parameter URL. For example www.example.com/index.php?page_id=1&no=2 I want that search engine see my page URL as; www.example.com/toys/cars But this URL is not exist in my website. And when i externally enter this page it goes to 404 page. If i add canonical url as www.example.com/toys/cars to the page www.example.com/index.php?page_id=1&no=2, what happened ? Is the url at the serp change as www.example.com/toys/cars ?
Technical SEO | | SEMTurkey0 -
Site problem
I moved a site earlier on in the year to a better server www.keyrs.co.uk, my main keywords being equity release - equity release calculator and equity release schemes. Since this happened the ranking have gone down and the schemes and calculator terms and have hit positions 7-8 when they were 2-3. basically my question is open to all, i am looking to see what the problem is with these pages as it is driving me nuts. All tools on SEO moz show the pages are doing well, however i must be missing something. Mike
Technical SEO | | TomBarker820