开发者

Want to change URL pattern

开发者 https://www.devze.com 2023-01-23 17:14 出处:网络
These days, I\'ve seen a URL pattern like this: http://stackoverflow.com/questions/How-to-do Not a u开发者_Go百科sual and old one like this:

These days, I've seen a URL pattern like this:

http://stackoverflow.com/questions/How-to-do

Not a u开发者_Go百科sual and old one like this:

http://stackoverflow.com/questions.php?id=123

or

http://stackoverflow.com/questions.php?q=How-to-do

As you know, the difference is that the former is using / directory pattern, and the latter is using ?key=value&key=value....

I guess it's something to do with server config. My language is JAVA and PHP, and Web container is TOMCAT6. Please teach me how to change URL patter. Because it looks more organized and brand new.

Thank you.


URL Rewriting can be achieved with PHP on Apache using the Apache mod_rewrite plugin and a rule definitions placed in a .htaccess file. Here's a guide.

On Tomcat 6 there is a popular URL rewriting utility called UrlRewrite.


What you want is Apache's mod_rewrite

Check this out: apache.org

0

精彩评论

暂无评论...
验证码 换一张
取 消