I am doing a php project but I am not good at url_rewrite module in apache and I wanna learn how to achieve this kind of url rewrite here:
http://www.something.com/press/release/something_1/
01
will be id
of the press_release so that part will be dynamic part. something
is also dynamic but not included in query_string part. This url is converted to the one below:
http://www.som开发者_高级运维ething.com/press/release/press_detail.php?rid=1
Can somebody show me how to write the url_rewrite rule for this conversion.
Place the following in the .htaccess
file in your web root:
RewriteEngine on
RewriteRule ^press/release/.*_(\d+)/?$ press/release/press_detail.php?rid=$1 [QSA]
精彩评论