[Logo] JForum - Powering Communities
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 


The final version of JForum 2.8.0 has been released with lots of improvements. Read all about it here

How to create Dynamic Url in Jforum ? RSS feed
Forum Index » User Forum
Author Message
subodh


Joined: 2014/8/26
Messages: 1
Offline
Right now url look like [http://jforum.andowson.com/posts/list/96.page] i want to know how can we create google friendly Url like [http://jforum.andowson.com/posts/list/Captcha is not showing in servere]

How can we create dynamic Urls

Thanks
andowson


Joined: 2011/6/30
Messages: 230
Offline
If you put Tomcat behind Apache HTTPD Server, then you can use Apache's rewrite module with some rewrite rule like the following in httpd.conf:
RewriteRule ^/posts/list/t/([1-9]+[0-9]*)/(.*)$ /posts/list/$1.page [P]

Notice that /posts/list/t/ prefix is used to distinguish from normal url ended with .page
And you can use the syntax to create it in freemarker template
/posts/list/t/${topic.topicId}/${topic.topicTitle?html}

For example:
http://jforum.andowson.com/posts/list/t/114/JForum 2.4.0 released

Or you can shorten the prefix from /posts/list/t/ to /t/ only
RewriteRule ^/t/([1-9]+[0-9]*)/(.*)$ /posts/list/$1.page [P]

And you can use the syntax to create it in freemarker template
/t/${topic.topicId}/${topic.topicTitle?html}

For example:
http://jforum.andowson.com/t/114/JForum 2.4.0 released

 
Forum Index » User Forum
Go to:   
Mobile view
Powered by JForum 2.8.0-b1 © 2021 JForum Team • Maintained by Andowson Chang and Ulf Dittmer