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
-
Downsides on shortening article title?
Hi there, I'm new to Moz: great tool so far! I just tried the page optimization feature and see that (for instance for this article) page titles are often too long. Now it's tempting to just shorten the title straight away, but I have a memory of someone once telling me changing the title will change the URL. And changing the URL is something not appreciated by Google. Could someone please explain if and why this is/isn't the case? And if there are any downsides/things to consider before changing the article's title? Thank you in advance!
On-Page Optimization | | RaoulWB1 -
Display URL changed for Organic Regional Searches?
Hey. We currently have a US version of the site (/us) which is displaying in US Google Search. However the /us domain is also showing for our co.uk Google searches. Is there a way I can ensure the /us is only displayed for US searches? Any thoughts would be greatly appreciated 🙂
On-Page Optimization | | LoveCrafts0 -
Best practice for URL structure - short and sweet, or double keyword?
We are just about to re-jig our main category pages and have found that different leading sites have taking different views on short and sweet url structure vs. repeated keywords1. For our website we have two options. We have two options: mywebsite.com/browse/birmingham/restaurants-in-birmingham or mywebsite.com/browse/birmingham/restaurants Someone like opentable have gone for short and sweet (opentable.co.uk/birmingham-restaurants) whereas people like Time Out have gone longer with multiple matches in the url (timeout.com/london/food-drink/londons-top-50-restaurants). Is there a consensus on which is better?
On-Page Optimization | | HireSpace0 -
Duplicate content shown in Google webmaster tools for 301 redirected URLs.
Why does Google webmaster tools shows 5 URLs that have been 301 redirected as having duplicate meta descriptions?
On-Page Optimization | | Madlena0 -
Moving Top rank Page urls off my Home page and nesting them on one page? Good idea?
I am basically trying to cut down the amount of links on my home page to make it less eye boggling and move stuff around. So i have of my Urls on my home page that lead to pages that rank very well within google. My questions is can i remove those urls to a separate page to group them together and then showcase that one link to that page on my home page. Is that a good idea or i am going to loose my link juice and position in search? The physical urls on those pages wont change at all.
On-Page Optimization | | Dante130 -
Canonical URL Tag
Hi, I have two pages that are identical on my site: http://www.absolutepower.nl/creatine-monohydraat and http://www.absolutepower.nl/CREATINE/creatine-monohydraat Should I use the canonical URL tag in this case? Thanks, Jasper
On-Page Optimization | | Japking0 -
Custom Landing Page URLs
I will begin creating custom landing pages optimized for long-tail keywords. Placing the keywords in the URL is obviously important -- Question: would it be detrimental to rankings to have extra characters extending past the keyword? I'm not able to use tracking code, but need to put an identifier in the URL (clp = custom landing page). For example, is "www.domain.com/silver-fish.html" going to perform meaningfully better than "www.domain.com/silver-fish-clp.html" for the kw phrase "silver fish"? There will obviously be a lot of on-page optimization in addition to just structuring the URLs. Thank you. SIMbiz
On-Page Optimization | | SIMbiz0 -
Seeking URL Advice
Hey Moz Community, I'm looking for some URL structure advice for a new directory of a website. We're trying to rank for the term 'internships abroad in <country>'</country> We have roughly 100 pages targeting specific countries. Right now the URL structure is www.gooverseas.com/internships-abroad/china, but some of my colleagues believe this structure would be better: www.gooverseas.com/internships-abroad/intern-in-china. I personally prefer the shorter structure, but we couldn't come to any agreement so we thought we'd pose the question to the community. Any thoughts? Thanks!
On-Page Optimization | | dunklea0