• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Know technique for dynamic URL change

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am working on real estate forum site where person can add there personal opinions , questions ,solutions etc.

I want to make that site SEO friendly.for that i need topic's Subject/title in url .
for coderanch Eg. https://coderanch.com/t/572347/Servlets/java/Servlet-Asynchronous-Operations

https://coderanch.com/t/572113/Web-Services/java/SOAP-REST-tightly-loosely-coupled

above url changing for each topic.how this i make possible by using java ,servlet ?
 
Ranch Hand
Posts: 90
Eclipse IDE Tomcat Server Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Google search URL rewriting.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only required part is everything up to the thread ID (https://coderanch.com/t/572113/), everything behind that is not significant and can be chosen at will (or left out altogether). So there's no "rewriting" going on here.
 
Ramesh Sengani
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes i agree with Marshal.. But In my servlet code i make that possible.? i am not getting any idea
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Making what possible? Creating URLs that contain parts which your web app simply ignores?
 
Ramesh Sengani
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i need that technique in my project. how do i make that possible in project. Suggest with some good example if you can. I am using Servlet + struts2
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Making what possible?


It's a URL to which you append whatever strikes your fancy when you display it someplace. Are you asking how to do string concatenation?
 
Ramesh Sengani
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need in struts2. Is possible for you to give some small example on it
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An example of what? What, specifically, are you struggling with to implement?
 
Ranch Hand
Posts: 119
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think what Ramesh want is how he can create or implement a SEO friendly url in his Struts application.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But there's nothing to it. If "https://coderanch.com/t/572113/" is the integral URL, all you need to do is to set up whatever code handles "/t" URLs to extract the ID from the URL and ignore everything that comes after it.
 
Ramesh Sengani
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for understanding my need Wayan..

Ulf Dittmer you are right but how can i cancat title or subject of topic before fetch. As per your suggestion "https://coderanch.com/t/572113/" based on 572113 id i will fetch topic from db. but i need url like this https://coderanch.com/t/572347/Servlets/java/Servlet-Asynchronous-Operations ,which is not possible before fetching..


Sorry i am stretching this topic but solution is really helpful for me
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "fetching", and what does a DB have to do with non-functional parts of an URL? Wherever you want to display the URL, just append whatever you want appended, and then ignore it when interpreting it on the server. That has no bearing on how the page that's behind the URL is stored or retrieved.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys, this post helped me a lot, I was going to ask about this issue but I found that Ramesh already asked it

I appreciate your efforts..

Thanks again
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic