URL naming Seo optimization like javaeye

Source: Internet
Author: User

Many websites, including javaeye, currently use Google auto-translation for URLs. For example, the URL of a news article in JE may be:

 

Http://www.javaeye.com/news/8750-google-will-launch-chrome-based-operating-system

 

The effect of such a URL is obvious for Seo. In fact, it is not very difficult to achieve this, as shown below:Code(The following is the Java code. The idea is very important ):

 

Public static string getseotitle (string Str) {<br/> string ret = ""; <br/> try {<br/> string translatedtext = translate. translate (STR, language. chinese, <br/> language. english); <br/> ret = translatedtext; <br/>} catch (exception ex) {<br/> ret = pinyin. getfullspell (STR, 2); <br/>}< br/> // additional random number <br/> random Rand = new random (); <br/> ret = utils. replace (Ret, "", "-"); <br/> RET + = "-" + Rand. nextint (1000); <br/> return ret; <br/>}

Running result:

 

Google-will-be-postponed-to-the-operating-system-based-on-the-Chrome-726

 

My practice is to use Google's auto-Translation results followed by a random number of less than 1000 to achieve the goal. If Google's auto-translation fails, the Chinese pinyin spelling will be used to add a random number, what is saved is to create a rewrite (Omitted) based on URL rules, which may be slightly different from je's practice for friends to authenticate!

 

Java Open Source Address: http://code.google.com/p/google-api-translate-java/

Online Demo, login: http://www.faqee.com/crm

Account/password: Test/test

Add a news item to news management. You can see the effect through the URL address!

 

 

Original article: http://cxlh.javaeye.com/blog/422372

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.