{"id":1501,"date":"2014-09-09T11:02:28","date_gmt":"2014-09-09T15:02:28","guid":{"rendered":"http:\/\/www.insidethe.com\/blog\/?p=1501"},"modified":"2014-09-09T11:07:58","modified_gmt":"2014-09-09T15:07:58","slug":"bookmark-apache-url-rewrite-to-control-access","status":"publish","type":"post","link":"https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/","title":{"rendered":"Bookmark &#8211; Apache URL Rewrite to Control Access"},"content":{"rendered":"<p>Was looking for some quick examples to block access to URL&#8217;s based on a rewrite rule and found this blog post:\u00a0<a href=\"http:\/\/www.netshinesoftware.com\/blog\/restricting-access-to-a-url-by-ip-address-using-mod-rewrite\/\">http:\/\/www.netshinesoftware.com\/blog\/restricting-access-to-a-url-by-ip-address-using-mod-rewrite\/<\/a> I&#8217;m copying the best bits here for easy reference.<\/p>\n<h5>Redirect traffic from specific hosts with specific query string<\/h5>\n<pre><span style=\"color: #000000;\">RewriteEngine On<\/span><\/pre>\n<pre>RewriteCond %{REMOTE_ADDR} ^123\\.255\\.123\\.255 [OR]<\/pre>\n<pre>RewriteCond %{REMOTE_ADDR} ^124\\.255\\.124\\.255 [OR]<\/pre>\n<pre>RewriteCond %{REMOTE_ADDR} ^125\\.255\\.125\\.255<\/pre>\n<pre><span style=\"color: #000000;\">RewriteCond %{QUERY_STRING} option=com_my_special_component [NC]<\/span><br style=\"color: #000000;\" \/><span style=\"color: #000000;\">RewriteRule ^(.*)$ index.php [F,L]<\/span><\/pre>\n<h5>Don&#8217;t redirect traffic from these hosts with specific query string<\/h5>\n<pre><span style=\"color: #000000;\">RewriteEngine On<\/span><br style=\"color: #000000;\" \/><span style=\"color: #000000;\">RewriteCond %{REMOTE_ADDR} !^123\\.255\\.123\\.255<\/span><br style=\"color: #000000;\" \/><span style=\"color: #000000;\">RewriteCond %{REMOTE_ADDR} !^124\\.255\\.124\\.255<\/span><br style=\"color: #000000;\" \/><span style=\"color: #000000;\">RewriteCond %{REMOTE_ADDR} !^125\\.255\\.125\\.255<\/span><br style=\"color: #000000;\" \/><span style=\"color: #000000;\">RewriteCond %{QUERY_STRING} option=com_my_special_component [NC]<\/span><br style=\"color: #000000;\" \/><span style=\"color: #000000;\">RewriteRule ^(.*)$ index.php [F,L]<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Was looking for some quick examples to block access to URL&#8217;s based on a rewrite rule and found this blog post:\u00a0http:\/\/www.netshinesoftware.com\/blog\/restricting-access-to-a-url-by-ip-address-using-mod-rewrite\/ I&#8217;m copying the best bits here for easy reference. Redirect traffic from specific hosts with specific query string RewriteEngine On RewriteCond %{REMOTE_ADDR} ^123\\.255\\.123\\.255 [OR] RewriteCond %{REMOTE_ADDR} ^124\\.255\\.124\\.255 [OR] RewriteCond %{REMOTE_ADDR} ^125\\.255\\.125\\.255 RewriteCond %{QUERY_STRING} option=com_my_special_component [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[31],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Bookmark - Apache URL Rewrite to Control Access - Insidethe.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bookmark - Apache URL Rewrite to Control Access - Insidethe.com\" \/>\n<meta property=\"og:description\" content=\"Was looking for some quick examples to block access to URL&#8217;s based on a rewrite rule and found this blog post:\u00a0http:\/\/www.netshinesoftware.com\/blog\/restricting-access-to-a-url-by-ip-address-using-mod-rewrite\/ I&#8217;m copying the best bits here for easy reference. Redirect traffic from specific hosts with specific query string RewriteEngine On RewriteCond %{REMOTE_ADDR} ^123.255.123.255 [OR] RewriteCond %{REMOTE_ADDR} ^124.255.124.255 [OR] RewriteCond %{REMOTE_ADDR} ^125.255.125.255 RewriteCond %{QUERY_STRING} option=com_my_special_component [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/\" \/>\n<meta property=\"og:site_name\" content=\"Insidethe.com\" \/>\n<meta property=\"article:published_time\" content=\"2014-09-09T15:02:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-09-09T15:07:58+00:00\" \/>\n<meta name=\"author\" content=\"Jared\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jared\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/\",\"url\":\"https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/\",\"name\":\"Bookmark - Apache URL Rewrite to Control Access - Insidethe.com\",\"isPartOf\":{\"@id\":\"https:\/\/insidethe.com\/blog\/#website\"},\"datePublished\":\"2014-09-09T15:02:28+00:00\",\"dateModified\":\"2014-09-09T15:07:58+00:00\",\"author\":{\"@id\":\"https:\/\/insidethe.com\/blog\/#\/schema\/person\/046e8441af869a735c4e31ac51541a99\"},\"breadcrumb\":{\"@id\":\"https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/insidethe.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bookmark &#8211; Apache URL Rewrite to Control Access\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/insidethe.com\/blog\/#website\",\"url\":\"https:\/\/insidethe.com\/blog\/\",\"name\":\"Insidethe.com\",\"description\":\"It is my space, but better than myspace\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/insidethe.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/insidethe.com\/blog\/#\/schema\/person\/046e8441af869a735c4e31ac51541a99\",\"name\":\"Jared\",\"sameAs\":[\"https:\/\/www.insidethe.com\/blog\"],\"url\":\"https:\/\/insidethe.com\/blog\/author\/jared\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bookmark - Apache URL Rewrite to Control Access - Insidethe.com","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/","og_locale":"en_US","og_type":"article","og_title":"Bookmark - Apache URL Rewrite to Control Access - Insidethe.com","og_description":"Was looking for some quick examples to block access to URL&#8217;s based on a rewrite rule and found this blog post:\u00a0http:\/\/www.netshinesoftware.com\/blog\/restricting-access-to-a-url-by-ip-address-using-mod-rewrite\/ I&#8217;m copying the best bits here for easy reference. Redirect traffic from specific hosts with specific query string RewriteEngine On RewriteCond %{REMOTE_ADDR} ^123.255.123.255 [OR] RewriteCond %{REMOTE_ADDR} ^124.255.124.255 [OR] RewriteCond %{REMOTE_ADDR} ^125.255.125.255 RewriteCond %{QUERY_STRING} option=com_my_special_component [&hellip;]","og_url":"https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/","og_site_name":"Insidethe.com","article_published_time":"2014-09-09T15:02:28+00:00","article_modified_time":"2014-09-09T15:07:58+00:00","author":"Jared","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jared","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/","url":"https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/","name":"Bookmark - Apache URL Rewrite to Control Access - Insidethe.com","isPartOf":{"@id":"https:\/\/insidethe.com\/blog\/#website"},"datePublished":"2014-09-09T15:02:28+00:00","dateModified":"2014-09-09T15:07:58+00:00","author":{"@id":"https:\/\/insidethe.com\/blog\/#\/schema\/person\/046e8441af869a735c4e31ac51541a99"},"breadcrumb":{"@id":"https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/insidethe.com\/blog\/2014\/09\/bookmark-apache-url-rewrite-to-control-access\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/insidethe.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Bookmark &#8211; Apache URL Rewrite to Control Access"}]},{"@type":"WebSite","@id":"https:\/\/insidethe.com\/blog\/#website","url":"https:\/\/insidethe.com\/blog\/","name":"Insidethe.com","description":"It is my space, but better than myspace","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/insidethe.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/insidethe.com\/blog\/#\/schema\/person\/046e8441af869a735c4e31ac51541a99","name":"Jared","sameAs":["https:\/\/www.insidethe.com\/blog"],"url":"https:\/\/insidethe.com\/blog\/author\/jared\/"}]}},"_links":{"self":[{"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/posts\/1501"}],"collection":[{"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/comments?post=1501"}],"version-history":[{"count":4,"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/posts\/1501\/revisions"}],"predecessor-version":[{"id":1505,"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/posts\/1501\/revisions\/1505"}],"wp:attachment":[{"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/media?parent=1501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/categories?post=1501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/insidethe.com\/blog\/wp-json\/wp\/v2\/tags?post=1501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}