user1745467
user1745467

Reputation: 67

editing htaccess [NC,P] rule to accept a number parameter

I have a htaccess rule as such:

RewriteRule ^apply/aff/check/?$ /index.php?task=dupe&format=raw [NC,P]

However I want to be able to pass a number that will change into the destination page like this:

apply/aff/check/X as in apply/aff/check/21

Should be redirected to

/index.php?task=dupe&format=raw&number=X

as in

/index.php?task=dupe&format=raw&number=21

However I also need the original to work also

Upvotes: 0

Views: 84

Answers (1)

anubhava
anubhava

Reputation: 784918

You can do:

RewriteRule ^apply/aff/check/?$ /index.php?task=dupe&format=raw [NC,P]

RewriteRule ^apply/aff/check/([0-9]+)?$ /index.php?task=dupe&format=raw&number=$1 [NC,P]

Upvotes: 1

Related Questions