Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #URL {mydomain}/polls/sort/CREATED/page/3
- #Any uri that starts with /{something}/{something}/sort/{string}
- RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*)/(.*)sort/([^/^\ ]*)
- #store the sort variable
- RewriteRule . - [E=sortBy:sort=%3&]
- #same as above but store the page variable
- RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*)/(.*)page/([^/^\ ]*)
- RewriteRule . - [E=page:p=%3]
- #if the sortby variable exist, rewrite the url
- RewriteCond ?%{ENV:sortBy} .+
- RewriteRule ^/([^/]*) /$1?%{ENV:sortBy}%{ENV:page} [L]
- #if the page variable exist, rewrite the url
- RewriteCond ?%{ENV:page} .+
- RewriteRule ^/([^/]*) /$1?%{ENV:sortBy}%{ENV:page} [L]
Add Comment
Please, Sign In to add comment