Articles URL
-
Hello,
Currently, I am parsing article base on article ID on URL request. For example:
To go to the content of article **What is the visa on arrival? How to get it? **I am using URL like that http://www.vietnamvisacorp.com/news/what-is-the-visa-on-arrival--how-to-get-it--245.html and base on ID 245 to get this page content.
But, now I want to optimize this URL to http://www.vietnamvisacorp.com/news/what-is-the-visa-on-arrival--how-to-get-it.html. Then I got a problem: How to get an article without ID?Thanks,
-
Well, you need to build some rewrite rules for that to work, it doesn't go automatically to the file querying the DB.
-
Hello,
My google webmaster reported that this URL http://www.vietnamvisacorp.com/news/245/what-is-the-visa-on-arrival-how-to-get-it.html is NOT FOUND and link from http://moz.com/community/q/articles-urlHow to fix this problem? Thank you for any help!
-
While don't getting the page URL (which is the article title "what-is-the-visa-on-arrival-how-to-get-it.html" remove the .html and then add an extra field to the DB with a the URL friendly name, for this article, that field will contain "what-is-the-visa-on-arrival-how-to-get-it" then you search your DB for that field and you get the entry ID (of course, adding an index to that new column).
This one is a good solution for small DBs, but when scaling, you may want to use an integer to get the post ID instead, say "http://www.vietnamvisacorp.com/news/245/what-is-the-visa-on-arrival-how-to-get-it.html"
You get the ID plus the title and avoid any issue that may come if you accidentally post an article with the same title (you can have this prevented by looking into the DB before saving the article and if the title exists, you can either change the title or add something to differentiate them, say "-2".
Hope that helps!
-
Hi Matt,
Thanks for your contributions. I don't use WordPress. We developed out website with python and django framework. My problem here: I could not map one-to-one from URL /what-is-the-visa-on-arrival--how-to-get-it.html with that page content in database. Please give me advice!
-
Hi John,
This depends on what CMS you are using (if any). If you're using WordPress then you can do this pretty easily by using a search engine friendly URL permalink (which you can often get plugins for on most CMS's).
Let us know what platform you are working on and it will be easier to diagnose.
Matt
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
-
To avoid the duplicate content issue I have created new urls for that specific site I am posting to and redirecting that url to the original on my site. Is this the right way to do it?
I am trying to avoid the duplicate content issue by creating new urls and redirecting them to the original url. Is this the proper way of going about it?
On-Page Optimization | | yagobi210 -
Is using hyphens in a URL to separate words good practice?
Hi guys, I have a client who wants to use a hyphen to separate two words in the URL to make each work stand out. Is is good or bad practice to use a hyphen in a URL and will it affect rankings? Thanks!
On-Page Optimization | | StoryScout0 -
Keyword in URL: Ranking Factor?
I've got a site about a specific topic, which we'll call "themes" for the sake of this discussion. I personally like to keep the url structure short and clean (for usability purposes, but mainly because I'm a perfectionist and a minimalist). I feel that adding "themes" to the url structure is a bit redundant. However, nearly every keyword phrase that my site should rank for includes the word "themes." So I'm wondering how much I'm handicapping myself by not including the keyword "themes" in the url? The domain name itself sort of includes the keyword . . . although it's in Italian (I chose the domain for it's brand-ability, not for the keyword). A quick example: My Url Structure: www.themo.com/topic/abc My Competitor's Url Structure: www.sitesample.com/themes/topic/abc For many of the keywords, the competitors with the keyword in the url rank highest. But, I'm not sure how much emphasis to place on this, because from my understanding Google doesn't pay as much attention to url keywords anymore . . . and those sites might just be ranking high because they've been around for so long (which also happens to be the reason why they coincidentally also include the keyword in the url, because they started the site when that was a high ranking factor). Thoughts? Should I just trash my perfectionism and add the keyword to the url structure? (By the way, the site is only a couple months old and doesn't have any significant backlinks to inner pages yet, so changing the url structure wouldn't be a big deal if I decided to do that).
On-Page Optimization | | JABacchetta0 -
Should a title tag and the URL be a 100 percent match?
My understanding is that a URL should be as short as possible and also match the title tag, but in order to keep the URL shorter, can you abbreviate it? For example: Title Tag: Eat Your Way to Beauty with Superfoods URL: websitename.com/sbeauty-with-superfoods
On-Page Optimization | | KimCalvert0 -
Duplicate Content- Best Practise Usage of the canonical url
Canonical urls stop self competition - from duplicate content. So instead of a 2 pages with a rank of 5 out of 10, it is one page with a rank of 7 out of 10.
On-Page Optimization | | WMA
However what disadvantages come from using canonical urls. For example am I excluding some products like green widet, blue widget. I have a customer with 2 e-commerce websites(selling different manufacturers of a type jewellery). Both websites have massive duplicate content issues.
It is a hosted CMS system with very little SEO functionality, no plugins etc. The crawling report- comes back with 1000 of pages that are duplicates. It seems that almost every page on the website has a duplicate partner or more. The problem starts in that they have 2 categorys for each product type, instead of one category for each product type.
A wholesale category and a small pack category. So I have considered using a canonical url or de-optimizing the small pack category as I believe it receives less traffic than the whole category. On the original website I tried de- optimizing one of the pages that gets less traffic. I did this by changing the order of the meta title(keyword at the back, not front- by using small to start of with). I also removed content from the page. This helped a bit. Or I was thinking about just using a canonical url on the page that gets less traffic.
However what are the implications of this? What happens if some one searches for "small packs" of the product- will this no longer be indexed as a page. The next problem I have is the other 1000s of pages that are showing as duplicates. These are all the different products within the categories. The CMS does not have a front office that allows for canonical urls to be inserted. Instead it would have to be done going into the html of the pages. This would take ages. Another issue is that these product pages are not actually duplicate, but I think it is because they have such little content- that the rodger(seo moz crawler, and probably googles one too) cant tell the difference.
Also even if I did use the canonical url - what happened if people searched for the product by attributes(the variations of each product type)- like blue widget, black widget, brown widget. Would these all be excluded from Googles index.
On the one hand I want to get rid of the duplicate content, but I also want to have these pages included in the search. Perhaps I am taking too idealistic approach- trying to optimize a website for too many keywords. Should I just focus on the category keywords, and forget about product variations. Perhaps I look into Google Analytics, to determine the top landing pages, and which ones should be applied with a canonical. Also this website(hosted CMS) seems to have more duplicate content issues than I have seen with other e-commerce sites that I have applied SEO MOZ to On final related question. The first website has 2 landing pages- I think this is a techical issue. For example www.test.com and www.test.com/index. I realise I should use a canonical url on the page that gets less traffic. How do I determine this? (or should I just use the SEO MOZ Page rank tool?)0 -
Canonical URLs and SEO
After publishing my new wordpress website my on page analysis shows two canonical urls on my homepage. In checking the source code the Yoast SEO plugin states my canoncial url is www.homepage.ca/ This is the only one showing. Having said this I do not add the trailing slash to anything on my url structure. Could this be why the on page analysis tool says there are 2? If so is there any way to resolve this?
On-Page Optimization | | casper4340 -
New Url Structure
Hey Guys We are working on a new site and in order to implement some of the new functions we need to restructure our url's , Will redirect everything correctly but I was looking for advice on the structure we need the word product / category subfolder for speed but would there be any benefit making them shorter ? what would you guys advise ? Category Current http://www.freestylextreme.com/uk/Home/Brands/DC-Shoe-Co-/default.aspx **New ** freestylextreme.com/uk/category/dc-shoe-co Product Current http://www.freestylextreme.com/uk/Home/Brands/DC-Shoe-Co-/Mens-DC-Shoe-Co-T-shirts/DC-Black-Unwind-T-Shirt---.aspx New freestylextreme.com/uk/product/dc-black-unwind-t-shirt
On-Page Optimization | | elbeno0 -
Ecommerce Product Subcategory URL
Our website has 5 main categories displayed in tabs in the header. The main landing page of each of the 5 categories is a paginated page (3pages- set up with canonical tags to avoid duplicate content) with a side bar which splits the main category into many subcategories. Each of these subcategories essentially filter the main landing page into more defined categories customers find useful (price/colour) BUT once clicked enter into a separate landing page. We have worked hard to avoid any duplicate content issues between these sub-landing pages and the main landing page. This was done as we wanted each of the subpages to organically rank (thus we went with this method rather than filters). Hope we didn't do the wrong thing there? The question is should these sub-landing pages route straight from home to have the best chance to get individually ranked or routed through the main category bearing in mind we have 5 main categories each with many subcategories. i.e. domain.co.uk/subcategory or domain.co.uk/category/subcategory Thanks in advance for any advice given.
On-Page Optimization | | jannkuzel0