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
-
From an SEO perspective, which is preferable in the URL for a non-English site: local language or English?
For example, the article is titled ' गर्मी में त्वचा की देखभाल कुछ यूँ करें' (English Meaning: Skin Care Tips for Summer), which one of these three URLs is best for SEO purpose? 1. example.com/ गर्मी-में-त्वचा-की-देखभाल/ (URL in local language, Hindi in this case) 2. example.com/summer-skin-care-tips/ (URL uses English words with English translation) 3. example.com/garmi-mein-twacha-ki-dekhbhaal/ (Hindi words, but written in Roman English) A response will be much appreciated, Amit
On-Page Optimization | | DusBus0 -
Dynamic URL Parameters + Woocommerce create 404 errors
Hi Guys,
On-Page Optimization | | jeeyer
Our latest Moz crawl shows a lot of 404-errors for pages that create dynamical links for users? (I guess it are dynamic links, not sure). Situation: On a page which shows products from brand X users can use the pagination icons on the bottom, or click on: View: / 24/48/All.
When a user clicks 48 the end of the link will be /?show_products=48
I think there were some pages that could show 48 products but do not exist anymore (because products are sold out for example), and that's why they show 404's and Moz reports them. How do I deal with these 404-errors? I can't set a 301-redirect because it depends on how many products are shown (it changes every time).
Should I just ignore these kind of 404-errors? Or what is the best way to handle this situation?0 -
I have a lot of internal duplicate content as intros to a series of articles, is this bad?
On a site that I'm working on there is a series of posts with the same beginning to their titles. All of the titles start with Christ's Church ("Mormons"): And then about the first four paragraphs of all these posts is exactly the same, it is just explaining this series of posts. I'll link to a couple of examples so you know what I'm talking about. I know there are several other problems with these posts/site 🙂 but I am specifically curious about the partial duplicate title and the first few paragraphs being duplicate. http://www.mormonchurch.com/3259/christs-church-mormons-helping-out-a-friend http://www.mormonchurch.com/2969/christs-church-mormon-happiness-is-found-only-through-christ There are about 30 posts similar to these. Thank you, I look forward to your responses.
On-Page Optimization | | ThridHour1 -
Sorry, but that URL is inaccessible
Our site is all on the https protocol so every time I use the on-page grader it tells me the link is unavailable. What can we do? When I use the http protocol (which is 301 redirected to the https) it still gives me the same message.
On-Page Optimization | | whiskeyfl1 -
What are the benefits of the URL meta tag?
We have too many meta tags and want to get rid of all the outdated ones. However, we don't want to eliminate valuable meta tags by mistake. So, before we say goodbye to the URL meta tag, we want to make sure we understand the pros and cons, if any. By the way, we are not referring to canonical URL tags, just URL as in:
On-Page Optimization | | GRIP-SEO0 -
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 -
Does it matter if a rel = "canonical" element is added to the beginning or the end of a URL?
I am curious to know if adding a rel = "canonical" tag to the end of a link element will affect its purpose?
On-Page Optimization | | Sharecare0 -
Site URL's
We are redeveloping our website, and have the option to amend URLs (with 301 redirects from old URL to new), so my question is: Would 'golfsite.com/golf-clubs' achieve superior rankings than 'golfsite.com/clubs' for the search term 'golf clubs' if all other factors were the same? Should the URL reflect the intended search term wherever possible?
On-Page Optimization | | swgolf1230