Redirect a range of IPs using RewriteCond

If you’re using Apache HTTPD 2.4 or later, you can use expressions to match REMOTE_ADDR against a CIDR mask. The short form looks like this: RewriteCond expr “-R ‘192.168.1.0/24′” The following longer form is also available, but the documentation suggests it is less efficient: RewriteCond expr “%{REMOTE_ADDR} -ipmatch ‘192.168.1.0/24′” That makes the full solution to … Read more

mod_rewrite: remove query string from URL?

This should do it: RewriteEngine On RewriteCond %{QUERY_STRING} ^page=1$ RewriteRule (.*) $1? [R=permanent] Line by line: You turn on the rewriting functionality. You specify as a condition (“if statement”) that the query string has to be exactly page=1 for the following rules to apply. Then you specify a rule that says substitute the entire path … Read more