开发者

how to check $1 and $2 subpatern exists or not in htacess

I want to implement htaccess rewriting for the following criteria

  1. Url we are havi开发者_开发问答ng example.com/param1
  2. Url we are having example.com/param1/param2

For url 1 I need to redirect to example.com/param1.php

For url 2 I need to redirect to example.com/param1/param2.php

How to write the htaccess code for this condition??


RewriteRule ^(param1(/param2)?)$ /$1.php [R=301]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜