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
-
Changing URL Structure From Flat to Pyramid Theme
Hello Mozzers, I have an on-page SEO question regarding URL structure. A few months back we hired a full-time SEO person who is working on-page right now and she really wants us to completely re-due our URL restructure from a flat to pyramid style (example below). Current URL structure / page title is: Dog training Collars - K9electronics.com
On-Page Optimization | | k9byron
http://www.k9electronics.com/dog-training-collars/ Small Dog training Collars - K9electronics.com
http://www.k9electronics.com/small-dog-training-collars/ Einstein ET-300TS Mini Dog Training Collar - K9electronics.com
http://www.k9electronics.com/einstein-et-300ts-mini-remote-dog-trainer.html Suggested URL structure / page title change: Quality Dog Training Collars - Lowest Price Guarantee - K9electronics
http://www.k9electronics.com/dog-training-collars/ Dog Training Collars - Small Dog - K9electronics.com
http://www.k9electronics.com/dog-training-collars/small-dog/ Einstein ET-300TS Mini - Dog Training Collars - K9electronics.com
http://www.k9electronics.com/dog-training-collars/small-dog/einstein-et-300ts-mini I guess you could say we are the poster-boys for Google penalties and have received just about every penalty in the book. Panda, penguin algo penalties and a partial manual action for unnatural links. Several months ago we removed 1000's of in-bound links and had our manual action lifted a few months back and are now hovering around the top / mid 2nd page for all our big terms ...we used to be top 3 for everything. As we were removing bad links, we also completely redesigned the site and removed lots of categories and products and 95% of all our old, low quality content and replaced it with new, high quality content. The site was really slooooow, so we optimized it and moved it to a big dedicated server and tripled page load time. Added rich snippets, Google authorship, increased our FB and other social presences and much more ... I had also considered this URL structure change during the redesign because I had heard and read that it was good to do, but it required redirecting practically all our URL's which I know can hurt the site even more so then it already has been ... Our SEO says that as it sits now, our pages are competing with each other and really seems to think this is going to improve our rankings a lot ...after several weeks. My question is, at this stage in the game, is it really going to help a lot and give us more benefit compared to the 301 redirect link juice loss? Any comments and/or suggestions are very much appreciated!1 -
Best URL structure for my page
Hey everyone, I am wondering what is the best URL structure for my activity booking page in Bali. http://www.thingstodoinbali.com/bali/sports/water-sports/rafting/ or http://www.thingstodoinbali.com/bali/sports/water-sports/rafting-bali/ or would you recommend something else? Most people would google for "activity bali" in this case "rafting bali". Please advice. Thanks for your time and help in advance!
On-Page Optimization | | c.eiermann0 -
Is it still worth changing a url with half the pages target keyphrase in to the entire phrase still ?
Hi If a pages url has half the pages target keyphrase (i.e. 1 word instead of 2) is it still worth changing to include entire keyphrase (2 words) given need to then add 301 redirects etc after ? If it was a new page then I would definately include full keyphrase but the page is a few months old and has quite high page authority as is (i know a 301 should transfer most authority) but given this page and other sub pages would also need to be 301'd if this change occurs and the dev time/cost that would incurred/charged by the design/dev agency. Also thinking Google being cleverer now (the pages content will be about the target kw) so thinking G would work it out from rest of page content and partial match kw in url. In other words to best target keyphrase is it best to leave url as is or change url to include keyphrase ? For example if the pages target kw is 'swimming clubs' and the current url is www.franksleisurecentres.com/clubs changing it to www.franksleisurecentres.com/swimming-clubs :Thanks Dan
On-Page Optimization | | Dan-Lawrence0 -
Does a URL forward slash break up an exact match phrase?
I've seen some organisations implementing keyword phrases per URL with forward slashes in-between the keywords. Would this still work for broad AND exact match keywords when the search engine references the URL? Here's an example with the keyword being "scuola di lingue tedesco". http://www.esl.ch/it/adulti/scuola-di-lingue/tedesco/index.htm Thanks in advance.
On-Page Optimization | | featherseo0 -
Replacing website, same URL, lose ranking
We had to do a rush job for a client and get a website up very quickly. We had to just replace the existing files on the server, but URL stayed the same. Now "teeth whitening glasgow" which they were number #1 for isn't coming up. Know there is still some on page work to be done - but the link profile should still remain the same? Just looking for some advice to get back to where they were - should we do a website change of address or just verify the site in Webmaster and get all the on page done? Thanks, Laura
On-Page Optimization | | lauratagdigital0 -
URL Length
I know a URL should "technically" shorter than 75 characters. Does that include the http://www.domainname.com ? Thank you 🙂
On-Page Optimization | | Libra0130 -
URL question
Hi guys, the pro campaign thing you got going is wicked, love it. I'm recieving good results with my keywords and have noticed that categories that go beyond sub/sub/sub don't do to well. So I wanna move those that do one step up which makes it go from: http://spytunes.com/practice-guitar/advanced-routine/scales/aeolian to here http://spytunes.com/practice-guitar/advanced-routine/aeolian The existing menu system that follow all these categories across the site will soon go so it won't be a user friendly problem, I will have other type of menus. But, and here is the question: Would I greatly benefit from taking the non existent menu away and just go for: http://spytunes.com/practice-guitar/aeolian while i'm at it? Or do I stick with my current structure? I guess my real question is; how much is there to flat URLs? Cheers -dan lundholm spytunes.com
On-Page Optimization | | spytunes0 -
Redirecting to a keyword-rich domain URL
It's best practice to choose a domain that has keyword in it. But if someone has just launched a website and the domain name does not have keyword, is it better to purchase a new domain name that has a keyword in the name and redirect existing domain to the new domain? Will that help SEO? (This just launched website does not have any traffic or links yet.)
On-Page Optimization | | Amjath0