tags:

views:

20

answers:

1

I want to implement htaccess rewriting for the following criteria

  1. Url we are having 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??

A: 
RewriteRule ^(param1(/param2)?)$ /$1.php [R=301]
Laurence Gonsalves