当前位置: 动力学知识库 > 问答 > 编程问答 >

apache2 - mod_rewrite - how to rewrite an URL?

问题描述:

Is there a way to rewrite an URL like

http://mydomain.com/getProduct.php?id=1&mode=simple

in

http://mydomain.com/products/1/simple

using mod_rewrite in Apache2?

网友答案:
RewriteRule /products/([0-9]+)/([a-z]+) /getProduct.php?id=$1&mode=$2

For more information search google for mod_rewrite tutorials.

网友答案:

You may find this article helpful: URL Rewriting for beginners.

Also search for Mod Rewrite Cheat Sheet in Scribed, I found it helpful before. [Sorry couldn't post the link as I am allowed to post only one link]

分享给朋友:
您可能感兴趣的文章:
随机阅读: