Benas Radzevicius
Benas Radzevicius

Reputation: 377

how to catch all url variables

My .htaccess file:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^((?!public).*)/([a-zA-Z0-9-]*) index.php?c=$1&a=$2 [NC]

How can i modify it that it could support more variables like: /user/login&d=example&e=example2, now it just ignores the part after /user/login...

Upvotes: 0

Views: 62

Answers (2)

LeonardChallis
LeonardChallis

Reputation: 7783

You can add this:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^((?!public).*)/([a-zA-Z0-9-]*) index.php?c=$1&a=$2&%{QUERY_STRING} [NC]

Notice the &%{QUERY_STRING}, which will add the rest of the query string to index.php

Upvotes: 2

Leon Armstrong
Leon Armstrong

Reputation: 1303

have a look on this tutorial should solve your problem

Upvotes: 0

Related Questions