會員註冊 / 登入  |  電腦版  |  Jump to bottom of page

User Forum » How to create Dynamic Url in Jforum ?

發表人: subodh
10 年 前
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
9 年 前
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





會員註冊 / 登入  |  電腦版  |  Jump to top of page