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
-
Placement of key words in URL
I notice that the MOZ Page Grader considers "/keyword1/keyword2-keyword3" in a URL string to be less effective than "/keyword1-keyword2-keyword3". Is this correct from Google's perspective? If I am trying to maximise my SEO for the page title "Business building tips", for example, does Google think my URL is more relevant if it's in the form: 1. www.website.com/business-building-tips
On-Page Optimization | | Gavin.Atkinson
2. www.website.com/business/building-tips or
3. www.website.com/business/business-building-tips My instinct tells me 3 is more powerful, but logic tells me if I have a whole section devoted to "business" and one of those pages is "business building tips" then 2 should work just as well, possibly better?0 -
Duplicate URL's in Sitemap? Is that a problem?
I submitted a sitemap to on Search Console - but noticed that there are duplicate URLs, is that a problem for Google?
On-Page Optimization | | Luciana_BAH0 -
How defined does the anchor text need to be for a domain url?
Ok, I'm looking to clean up my domain with irrelevant Anchor text linking to specific URL's. Whether, it's my root domain or a particular product URL. I'm finding a wide variety of terms (anchor text) pointing to my homepage, category and finally my product pages. Example, the Anchor text "Paragon Print Systems" is pointing to my homepage "barcodefactory.com" does this hurt my homepage enough to either have the link/anchor text removed from linking to my homepage? thanks much!, Warren
On-Page Optimization | | Warren.W0 -
Googlebot indexing URL's with ? queries in them. Is this Panda duplicate content?
I feel like I'm being damaged by Panda because of duplicate content as I have seen the Googlebot on my site indexing hundreds of URL's with ?fsdgsgs strings after the .html. They were beign generated by an add-on filtering module on my store, which I have since turned off. Googlebot is still indexing them hours later. At a loss what to do. Since Panda, I have lost a couple of dozen #1 rankings that I've held for months on end and had one drop over 100 positions.
On-Page Optimization | | sparrowdog0 -
URL advice
Hi & thanks for looking, I'm not sure if I've adopted the best SEO URL structure for my site, www.vintageheirloom.com For instance, www.vintageheirloom.com/product-category/authentic-designer-vintage-bags/ Works great for the top level category 'All bags', as I'm trying to keyword authentic designer vintage bags. However the sub categories for instance 'Clutch bags' appears as, www.vintageheirloom.com/product-category/authentic-designer-vintage-bags/vintage-clutch-bags/. As you can see at the moment this URL contains duplicate terms vintage & bags. I'm guessing that duplicate keywords in a url isn't too smart, but should amend with Option 1, 2, 3 or something completely different? Option 1 - keep the top level category url the same, change the subcategory: www.vintageheirloom.com/product-category/authentic-designer-vintage-bags/clutch/ Option 2 - amend the top level category: www.vintageheirloom.com/product-category/authentic-designer/vintage-clutch-bags/ Option 3 - amend the top level category as this: www.vintageheirloom.com/product-category/bags/authentic-designer-vintage-clutch/ By the way I'm using WordPress with Woocommerce. I've asked but it's not possible with some technical issues to remove the /product-category/ section. But each product is for example just: www.vintageheirloom.com/shop/vintage-coach-yellow-duffel-sac-bag/ .... sweet. Thanks again !!
On-Page Optimization | | well-its-1-louder0 -
How do I remove a Canonical URL Tag?
Some of my report cards say I have too many canonical URL tags. However, there is no information no how to delete one. Can someone give me a link or explain? Thanks.
On-Page Optimization | | dealblogger0 -
What to do with 40 short articles to make room for 5 good thorough ones
Hello, On my life coaching website, I have 40 articles that I want to replace with 5 good ones (to get up-to-date in modern content writing). The new articles will be long, thorough, and graphically stimulating. What do I do with all these old short articles. There's no backlinks on them, but they are gaining a little traffic. I'm not sure I want them around since they're not high quality enough. What's normally done?
On-Page Optimization | | BobGW0 -
Disadvantages & Advantages for this e-commerce URL Structure
Hi all, Just a simple question. What's the disadvantages/advantages to using this URL structure for an ecommerce site: **Category structure: **/category **Subcategory structure: **/subcategory **Product structure: **/product Compared to the standard: /category/subcategory/product Thanks, Nick
On-Page Optimization | | NickPateman810