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
-
Can you help by advising how to stop a URL from referring to another URL on my website with a 404 errorplease?
How to stop a URL from referring to another URL on my site. I'm getting a 404 error on a referred URL which is (https://webwritinglab.com/know-exactly-what-your-ideal-clients-want-in-8-easy-steps/[null id=43484])referred from URL (https://webwritinglab.com/know-exactly-what-your-ideal-clients-want-in-8-easy-steps/) The referred URL is the URL page that I want and I do not need it redirecting to the other URL as that's presenting a 404 error. I have tried saving the permalink in WordPress and recreated the .htaccess file and the problem is still there. Can you advise how to fix this please? Is it a case of removing the redirect? Is this advisable and how do I do that please? Thanks
Technical SEO | | Nichole.wynter20200 -
Duplicate content problem?
Hello! I am not sure if this is a problem or if I am just making something too complicated. Here's the deal. I took on a client who has an existing site in something called homestead. Files cannot be downloaded, making it tricky to get out of homestead. The way it is set up is new sites are developed on subdomains of homestead.com, and then your chosen domain points to this subdomain. The designer who built it has kindly given me access to her account so that I can edit the site, but this is awkward. I want to move the site to its own account. However, to do so Homestead requires that I create a new subdomain and copy the files from one to the other. They don't have any way to redirect the prior subdomain to the new one. They recommend I do something in the html, since that is all I can access. Am I unnecessarily worried about the duplicate content consequences? My understanding is that now I will have two subdomains with the same exact content. True, over time I will be editing the new one. But you get what I'm sayin'. Thanks!
Technical SEO | | devbook90 -
Removing a URL from Search Results
I recently renamed a small photography company, and so I transferred the content to the new website, put a 301-redirect on the old website URL, and turned off hosting for that website. But when I search for certain terms that the old URL used to rank highly for (branded terms) the old URL still shows up. The old URL is "www.willmarlowphotography.com" and when you type in "Will Marlow" it often appears in 8th and 9th place on a SERP. So, I have two questions: First, since the URL no longer has a hosting account associated with it, shouldn't it just disappear from SERPs? Second, is there anything else I should have done to make the transition smoother to the new URL? Thanks for any insights you can share.
Technical SEO | | williammarlow0 -
Identifying a 301-redirect problem?
I was looking at the Search Engine Optimization reports for one of my clients in Google Analytics, and I saw that their two biggest landing pages are www.website.com and http://website.com. Does this mean that Google is serving both the 'www' and 'non-www' versions of the website, and thus harming the website's overall ranking? Thanks for any input!
Technical SEO | | williammarlow0 -
Order of keyword usage in URL
Hi, I have been wondering for a few weeks if the order of keyword usage for a long tail keyword made a difference. Today I ran an on-page report here for a new page which is a review of a product. The report warned about the keyword usage in URL which made me question my knowledge about this. let's say the page is titled Razer Mouse Review my URL is www.example.com/review/razer-mouse I thought it was a bad idea to repeat the same word in a URL, that's why I categorized all my reviews under review directory and avoided using the word "review" more than once. Should I modify this url and make it www.example.com/review/razer-mouse-review Note: I see the report listed this under "moderate importance factors" and still gave the page A grade. any ideas appreciated!
Technical SEO | | Gamer070 -
Problem generating backlinks
Hello everyone, Over the past couple of days I have been using a variety of different free and paid programs to check how many backlinks I have. I have used at least 15 different ones, SEOmoz is the newest and am awaiting those results. All but one of those programs have said that I have 0 backlinks. The one said I have 11. The thing is...over the past month I have submitted my site to over 500 PR0 directories, 250+ PR3-PR7 directories, have made well over 75 article submissions to over 20 websites(almost all of them were approved and up and running, and some of these websites have a PR of 7), a couple dozen Press Releases, set up profiles linking to my site on over 50 forums, set up profiles linking to my site on a variety of different Web 2.0 sites, and still nothing. I have been doing this every day for over a month. Anyone have any ide?
Technical SEO | | tarik30010 -
Problem wth Crawling
Hello, I have a website http://digitaldiscovery.eu here in SEOmoz. Its strange since the last week SEOmoz is crawling only one page! And before it was crwaling all the pages. Whats happening? Help SEOmoz! :))
Technical SEO | | PedroM0 -
URL rewrite question
I have adjusted a setting in my CMS and the URL's have changed from http://www.ensorbuilding.com/section.php/43/1/firestone-epdm-rubbercover-flat-roofing to http://www.ensorbuilding.com/section/43/1/firestone-epdm-rubbercover-flat-roofing This has changed all the URL's on the website not just this example. As you can see , the .php extension has now been removed but people can still access the .php version of the page. What I want is a site-wide 301 redirect but can not figure out how to implement it? Any help is appreciated 🙂 Thanks
Technical SEO | | danielmckay70