• Home Page
  • Privacy Policy
  • Disclaimer
  • Disclosure
  • Contact

DevelopPark Developers Programming Skills Exchange Park

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

Tag: .htaccess Author: bybylove1106 Date: 2009-11-03

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??

Other Answer1

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

Relate

  • check if there exists a[i] = 2*a[j] in an unsorted array a?
  • Batch file- Check if %2 exists if not set it to 0
  • Actionscript 2 - How to check if movie clip exists on specific position of stage?
  • how to read and modify this bash script to check for 2 arguments instead of 1?
  • How to create a folder named “1” (If not exists) then create a folder named “2” (if not exist in the same directory)and so on
  • in gql (appengine), how do i check if an entity exists matching 2 filters before inserting a new one?
  • check directory content every 2 second and copy its content if some file exists there in bash
  • Check if directory exists in lua?
  • check if email are valid and exists
  • check if file exists
  • Wix check if file exists?
  • Check if an Object exists in VBScript
  • Check if registry key exists
  • Check if Trendline Exists in VBA
  • Check if Session still exists

© Copyright ask.programmershare.com.

Design by ask.programmershare.com