checkenginelight
checkenginelight

Reputation: 1146

Mod Rewrite one variable or another on single rule?

Would it be possible to call one variable or another?

My type page gets either tag or type variables.

The code I have doesn't work, it only catches the first variable, tag.

How can I combine it into one or if not possible how do I make both work?

ex:

RewriteRule ^hen/egg/([^/\.]+)/?$ type.php?tag=$1 [L]
RewriteRule ^hen/egg/([^/\.]+)/?$ type.php?type=$1 [L]

Upvotes: 0

Views: 74

Answers (1)

Madara's Ghost
Madara's Ghost

Reputation: 174957

Use different virtual paths for them:

RewriteRule ^hen/tag/([^/\.]+)/?$ type.php?tag=$1 [L]
RewriteRule ^hen/type/([^/\.]+)/?$ type.php?type=$1 [L]

Upvotes: 2

Related Questions