Harmjan
Harmjan

Reputation: 132

How can I combine this two htaccess rules?

I have two conditions for the pages /portfolio and /portfolio/

RewriteRule ^portfolio$ index.php?p=portfolio&%{QUERY_STRING}
RewriteRule ^portfolio/$ index.php?p=portfolio&%{QUERY_STRING}

Is there a possibility to combine this conditions?

Upvotes: 0

Views: 83

Answers (1)

Marian Theisen
Marian Theisen

Reputation: 6353

RewriteRule ^portfolio/?$ index.php?p=portfolio&%{QUERY_STRING}

the ? says "exactly 0 or 1 '/'"

Upvotes: 2

Related Questions