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
-
Should I utilize URL re-writes to include keywords and other optimised page elements on my website?
Hi there, I am working on a medical recruitment website: https://wave.com.au/ I have noticed that our Job Search and Job Listings section of the website is lacking a little bit in terms of SEO optimisation. For example, at the moment this is our search page (with locum work type selected): https://wave.com.au/search-locum/results If you add a location, for example, NSW and then click search again, it updates the URL to: https://wave.com.au/search-locum/results?LocumSearchForm_Location[]=NSW&action_doSearch=Search+jobs I did a check what some competitors and leaders in the recruitment industry were doing and I came across: https://www.ochrerecruitment.com.au/jobs/anaesthetics/new-south-wales/locum/ If you click the different filters/options, it updates the URL to include more clearly defined categories. Some websites would even have a H1 heading tag that would update based on the filters/options you selected. Should I set up a set of URL re-writes and re-structure my website a little bit so that dynamic URLs change to static etc.? Does anyone have any best practice knowledge in regards to this? I have been referencing the following article: https://moz.com/blog/dynamic-urls-vs-static-urls-the-best-practice-for-seo-is-still-clear
On-Page Optimization | | Wavelength_International0 -
Update old article or publish new content and redirect old post?
Hi all, I'm targetting a keyword and we used to rank quite good for it. Last couple of months traffic of that keyword (and variations) is going down a bit. I wrote an extensive new post on the same topic, much more in dept and from 600 to 1800 words covering the same topic. Is it better to update the old article and mention that it's updated recently, or publish a new post and redirect the old post to the new post?
On-Page Optimization | | jorisbrabants0 -
I have lots of articles on my website. Should I add myself as the Author Rank for seo purposes
Hi All, We have lots of articles on our news page of our website. Should we add one of us as the author to gain Author Rank points so to speak ?.. Have not done anything previously with this but just wondered if we were missing a trick here thanks Pete
On-Page Optimization | | PeteC120 -
How to avoid duplicates when URL and content changes during the course of a day?
I'm currently facing the following challenge: Newspaper industry: the content and title of some (featured) articles change a couple of times during a normal day. The CMS is setup so each article can be found by only using it's specific id (eg. domain.tld/123). A normal article looks like this: domain.tld/some-path/sub-path/i-am-the-topic,123 Now the article gets changed and with it the topic. It looks like this now: domain.tld/some-path/sub-path/i-am-the-new-topic,123 I can not tell the writers that they can not change the article as they wish any more. I could implement canonicals pointing to the short url (domain.tld/123). I could try to change the URL's to something like domain.tld/some-path/sub-path/123. Then we would lose keywords in URL (which afaik is not that important as a ranking factor; rather as a CTR factor). If anyone has experiences sharing them would be greatly appreciated. Thanks, Jan
On-Page Optimization | | jmueller0 -
Image URL's have knocked my sub-pages down (WP)
I had most of my keywords within the top 10 for this site, some were even ranking in the top 5. For a possible minor boost, more-so to cover all the bases, I decided to add images to all of the pages, and they were uploaded as a gallery with most of the image file names being the same as the keyword. Thus, url's were created with our targeted phrases, extending off of the corresponding sub-page. After that, Google quickly picked up the url's to the images and began indexing them, when that occurred the sub-page which was to be the landing page, quickly tanked. Nothing else on-site changed besides the uploading of the images, so I'm sure they're conflicting and for whatever reason Google can't decide which page to index. The page that contains the images used, or the actual intended landing page. With WP I didn't see a way to not have them link to anything at all, and just be static when using a gallery, stock at least. So, my question is how can I quickly alleviate this problem and what should I do in the future to avoid this? I believe if I change link thumbnails to image file instead of attachment page, that should fix the issue... Then, I'll have dead URL's which I suppose I should 301 to the sub-page. Alternatively, is there a better solution that will work, I was also thinking about no-indexing the attachment URL's, but that doesn't seem to be an option.
On-Page Optimization | | JayAdams320 -
Changing url in connection with meta title inconsistency
We run a site, which is a directory type one, where visitors can look for local businesses per city as well (at some point similar to the 'Yelp concept'). Now, we use www.example.com as the homepage, and the www.example.com/city1, where city1 is the capital of our country, is 301 redirected to the homepage, so this is your default setting. When you choose e.g city2, your url changes to www.example.com/city2, and the city value is stored in a cookie. Then, when you leave the session, and return to the site later on, you will see the homepage url, but with your previous choice of city (in case you let cookies be stored). My concern is, that the meta title always contains the chosen city name, so when you return to the website, and you previously used city2, you will now see the homepage url (which normally belongs to city1), but with the meta title of city2 or with any other previously chosen city. Does this mean a problem, and should I always use the correct url, which would be www.example.com/cityX, or this could not cause a problem for me? If it does, would you mind sharing me the exact problems as well? Thanks,
On-Page Optimization | | Dilbak0 -
Does having a "+" in a URL hurt SEO? Would much value be gained changing it to a hyphen?
There's a site that contains "+" signs in the URL in order to call different information for the content on the page. Would it be better to change those to hyphens (-), or not that much value will be gained, so leave them as is? Thanks!
On-Page Optimization | | MitchellStoker0