{"id":2783,"date":"2020-12-17T07:29:28","date_gmt":"2020-12-17T07:29:28","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=2783"},"modified":"2025-10-02T05:21:52","modified_gmt":"2025-10-02T05:21:52","slug":"apache-deny-access-to-url-files-directory","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/","title":{"rendered":"Apache Deny Access to URL, Files &#038; Directory"},"content":{"rendered":"\n<p>Apache is a popular web server that provides tons of access control features for web administrators. While running a website, you may need to limit access to URL, files &amp; directories, due to their sensitive information. Apache makes it easy to restrict access using <em>Deny<\/em> and <em>Allow<\/em> server directives. In this article, we will look at how to deny access to URL, File &amp; Directory in Apache web server.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#Why_Deny_Access_to_URLs_Directory\" >Why Deny Access to URLs &amp; Directory<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#Apache_Deny_Access_to_URL_Files_Directory\" >Apache Deny Access to URL, Files &amp; Directory<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#1_Open_Apache_Configuration_File\" >1. Open Apache Configuration File<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#Apache_Restrict_Access_by_IP_in_Virtual_Host\" >Apache Restrict Access by IP in Virtual Host<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#Apache_Restrict_Access_using_htaccess\" >Apache Restrict Access using .htaccess<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#2_Restrict_Access_by_IP\" >2. Restrict Access by IP<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#Block_Access_to_URL\" >Block Access to URL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#Block_Access_to_Directory\" >Block Access to Directory<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#Block_Access_to_File\" >Block Access to File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#Restrict_Access_Using_htaccess\" >Restrict Access Using .htaccess<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#Apache_Limit_Access_by_multiple_IPs\" >Apache Limit Access by multiple IPs<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#3_Restart_Apache_web_server\" >3. Restart Apache web server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Deny_Access_to_URLs_Directory\"><\/span>Why Deny Access to URLs &amp; Directory<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Almost every website has private URLs, files and directories that contain sensitive information. It is essential to prevent unauthorized access to them to protect your website from being exploited. Sometimes you may need to block access to URLs from specific IPs or IP ranges. On the other hand, sometimes you may want to allow access to URLs from specific IPs or IP ranges. In all these cases, you will need to use access control features provided by Apache server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Apache_Deny_Access_to_URL_Files_Directory\"><\/span>Apache Deny Access to URL, Files &amp; Directory<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Apache provides <em><a href=\"https:\/\/httpd.apache.org\/docs\/2.4\/howto\/access.html\" target=\"_blank\" rel=\"noreferrer noopener\">Deny<\/a><\/em> directive to block one or more IP addresses. Similarly, it provides Allow directive to allow access from one or more IP addresses. Depending on how your website is structured and the kind of access permissions you have, you can add these directives in Apache main configuration file, virtual host file or .htaccess file. Here are the steps to restrict access to URL, files &amp; directories in Apache.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Open_Apache_Configuration_File\"><\/span>1. Open Apache Configuration File<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Apache configuration file is located at one of the following locations, depending on your Linux distribution. <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/etc\/apache2\/httpd.conf<\/code><\/li>\n\n\n\n<li><code>\/etc\/apache2\/apache2.conf<\/code><\/li>\n\n\n\n<li><code>\/etc\/httpd\/httpd.conf<\/code><\/li>\n\n\n\n<li><code>\/etc\/httpd\/conf\/httpd.conf<\/code><\/li>\n<\/ul>\n\n\n\n<p>Open terminal and run the following command to open Apache configuration page.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo vi \/etc\/httpd\/conf\/httpd.conf<\/pre>\n\n\n\n<p>If you make changes in Apache server configuration file, it will be applicable for all websites\/domains that you run on your Apache web server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Apache_Restrict_Access_by_IP_in_Virtual_Host\"><\/span>Apache Restrict Access by IP in Virtual Host<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you are running multiple websites on Apache server, using virtual host, then open the virtual host configuration file of the website (e.g www.website.com) for which you want to deny access to IP. Let&#8217;s say your virtual host configuration file is located at <em>\/etc\/apache2\/sites-enabled\/website.conf<\/em><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo vi \/etc\/apache2\/sites-enabled\/website.conf<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Apache_Restrict_Access_using_htaccess\"><\/span>Apache Restrict Access using .htaccess<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you do not have access to Apache&#8217;s main configuration file or virtual host file, then you will need to modify the .htaccess file of your website. In this case, it is assumed that mod_rewrite(.htaccess) is already enabled on your website. Open the .htaccess file in text editor.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo vi \/var\/www\/html\/.htaccess<\/pre>\n\n\n\n<p>Also read : <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-server-side-includes-ssi-in-apache\/\">How to Enable Server Side Includes in Apache<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Restrict_Access_by_IP\"><\/span>2. Restrict Access by IP<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Let us assume you want to limit access to <em>\/product<\/em>.html URL by IP 45.34.21.10. Here is the Deny directive to block access from this IP.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Deny 45.34.21.10<\/pre>\n\n\n\n<p>We will look at several common use cases to apply this directive.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Block_Access_to_URL\"><\/span>Block Access to URL<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Once you have opened the appropriate configuration file, look for &lt;Location&gt; tag for the above URL. Add the following line in it to prevent access from IP 45.34.21.10.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Deny 45.34.21.10<\/pre>\n\n\n\n<p>Your Location tag will look something like the following<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;Location \/product.html&gt;\n   ...\n   Deny 45.34.21.10\n   ...\n&lt;\/Location&gt;<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Block_Access_to_Directory\"><\/span>Block Access to Directory<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you want to block IP from accessing a specific directory such as <em>\/admin<\/em>, then add the above Deny directive location block of <em>\/admin<\/em> subfolder.<\/p>\n\n\n\n<pre id=\"block-4d6f70ba-c6a9-4ea3-8756-924bf27379f0\" class=\"wp-block-preformatted\">&lt;Location \/admin&gt;\n   ...\n   Deny 45.34.21.10\n   ...\n&lt;\/Location&gt;<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Block_Access_to_File\"><\/span>Block Access to File<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you want to block IP from accessing a specific file such as \/var\/www\/html\/input.html, then add the above Deny directive in Directory tag of <em>input.html<\/em> file.<\/p>\n\n\n\n<pre id=\"block-4d6f70ba-c6a9-4ea3-8756-924bf27379f0\" class=\"wp-block-preformatted\">&lt;Directory \/var\/www\/html\/input.html&gt;\n   ...\n   Deny 45.34.21.10\n   ...\n&lt;\/Directory&gt;<\/pre>\n\n\n\n<p><strong>Please note<\/strong>, use <em>Location<\/em> block to restrict access to URLs (e.g \/index.html, \/product ) and directories, and use <em>Directory<\/em> block to limit access to files (e.g \/var\/www\/html\/config.php). These <em>Location<\/em> and <em>Directory<\/em> blocks can be placed in Apache server configuration file, or virtual host block. They will not work in .htaccess file. If you are using .htaccess file then you need to simply add the Deny statement directly to .htaccess file and place the .htaccess file in the directory that you want to block.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Restrict_Access_Using_htaccess\"><\/span>Restrict Access Using .htaccess<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Alternatively, if you are using .htaccess then it is easier to use RedirectMatch directive to block access to URL, Directory and files.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RedirectMatch 403 ^\/folder\/product.html$ # blocks access to file<br>RedirectMatch 403 ^\/folder\/?$  # blocks access to only folder<br>RedirectMatch 403 ^\/folder\/.*$ # blocks access to folder and its contents<\/pre>\n\n\n\n<p>Also Read : <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-disable-etags-in-apache-server\/\">How to Disable ETags in Apache<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Apache_Limit_Access_by_multiple_IPs\"><\/span>Apache Limit Access by multiple IPs<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you want to limit access to multiple IPs, add separate Deny directives for each IP. In the following example, we limit access to IPs 45.34.21.10 and 65.34.23.12<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;Location \/product.html &gt;\n   ...\n   Deny 45.34.21.10\n   Deny 65.34.23.12\n   ...\n&lt;\/Location&gt;<\/pre>\n\n\n\n<p>If you want to restrict access by IP range such as 45.54.20.0-45.54.20.255 then you can do it by using <a href=\"https:\/\/www.ipaddressguide.com\/cidr\" target=\"_blank\" rel=\"noreferrer noopener\">CIDR<\/a> notation of this IP range. Here&#8217;s the configuration to restrict access from above IP range.<\/p>\n\n\n\n<pre id=\"block-e7c00924-daee-4064-ac97-b5ad0988a76f\" class=\"wp-block-preformatted\">&lt;Location \/product.html &gt;\n   ...\n   Deny 45.54.20.0\/24\n   ...\n&lt;\/Location&gt;<\/pre>\n\n\n\n<p>Alternatively, you can also <a href=\"https:\/\/ubiq.co\/tech-blog\/password-protect-directory-apache\/\">password protect directory<\/a> in Apache server.<\/p>\n\n\n\n<p>Also read : <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-fix-414-request-uri-too-large-in-apache\/\">How to Fix 414 Request Too Large Error<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Restart_Apache_web_server\"><\/span>3. Restart Apache web server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Restart Apache web server to apply changes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># service httpd restart\nOR \n# systemctl restart httpd\nOR\n# sudo service apache2 restart<\/pre>\n\n\n\n<p>Now when a user tries to access your URL, file or directory from blocked IP address, they will get a &#8220;403: Access Forbidden&#8221; response.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt several simple ways to easily deny access to URL, Directories and Files from one or more IP addresses. The key is to place the Deny directive in the appropriate configuration file. Depending on your requirement, you can place it in Apache&#8217;s main configuration file, virtual host file or .htaccess file. If you want to block a URL or directory, you need to place it in Location tag whereas if you want to block a file, then you need to place it in Directory tag. If you want to block access from multiple IP addresses, you can add separate Deny statements, one for each IP address. If you want to restrict access from a range of IP addresses, then it is better to use CIDR notation to cover the IP address range, instead of using individual IP addresses. As you can see, it is quite flexible and versatile.<\/p>\n\n\n\n<p><a href=\"http:\/\/ubiq.co\/\">Ubiq<\/a>&nbsp;makes it easy to visualize data in minutes, and monitor in real-time dashboards.&nbsp;<a href=\"http:\/\/ubiq.co\/accounts\/register\">Try it<\/a> today!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you may need to restrict access to URL, file or directory. Here is how to deny access  to URL, Files &#038; Directory in Apache.<\/p>\n","protected":false},"author":1,"featured_media":2788,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[251],"class_list":["post-2783","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","tag-deny-access"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Apache Deny Access to URL, Files &amp; Directory - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Sometimes you may need to restrict access to URL, file or directory. Here is how to deny access to URL, Files &amp; Directory in Apache.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache Deny Access to URL, Files &amp; Directory - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Sometimes you may need to restrict access to URL, file or directory. Here is how to deny access to URL, Files &amp; Directory in Apache.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-17T07:29:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-02T05:21:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/restrict-access-apache.png\" \/>\n\t<meta property=\"og:image:width\" content=\"840\" \/>\n\t<meta property=\"og:image:height\" content=\"356\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/apache-deny-access-to-url-files-directory\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/apache-deny-access-to-url-files-directory\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"Apache Deny Access to URL, Files &#038; Directory\",\"datePublished\":\"2020-12-17T07:29:28+00:00\",\"dateModified\":\"2025-10-02T05:21:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/apache-deny-access-to-url-files-directory\\\/\"},\"wordCount\":984,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/apache-deny-access-to-url-files-directory\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/restrict-access-apache.png?fit=840%2C356&ssl=1\",\"keywords\":[\"deny access\"],\"articleSection\":[\"Apache\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/apache-deny-access-to-url-files-directory\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/apache-deny-access-to-url-files-directory\\\/\",\"name\":\"Apache Deny Access to URL, Files & Directory - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/apache-deny-access-to-url-files-directory\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/apache-deny-access-to-url-files-directory\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/restrict-access-apache.png?fit=840%2C356&ssl=1\",\"datePublished\":\"2020-12-17T07:29:28+00:00\",\"dateModified\":\"2025-10-02T05:21:52+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Sometimes you may need to restrict access to URL, file or directory. Here is how to deny access to URL, Files & Directory in Apache.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/apache-deny-access-to-url-files-directory\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/apache-deny-access-to-url-files-directory\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/apache-deny-access-to-url-files-directory\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/restrict-access-apache.png?fit=840%2C356&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/restrict-access-apache.png?fit=840%2C356&ssl=1\",\"width\":840,\"height\":356,\"caption\":\"deny access in apache\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/apache-deny-access-to-url-files-directory\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apache Deny Access to URL, Files &#038; Directory\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apache Deny Access to URL, Files & Directory - Ubiq BI","description":"Sometimes you may need to restrict access to URL, file or directory. Here is how to deny access to URL, Files & Directory in Apache.","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:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/","og_locale":"en_US","og_type":"article","og_title":"Apache Deny Access to URL, Files & Directory - Ubiq BI","og_description":"Sometimes you may need to restrict access to URL, file or directory. Here is how to deny access to URL, Files & Directory in Apache.","og_url":"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-12-17T07:29:28+00:00","article_modified_time":"2025-10-02T05:21:52+00:00","og_image":[{"width":840,"height":356,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/restrict-access-apache.png","type":"image\/png"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"Apache Deny Access to URL, Files &#038; Directory","datePublished":"2020-12-17T07:29:28+00:00","dateModified":"2025-10-02T05:21:52+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/"},"wordCount":984,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/restrict-access-apache.png?fit=840%2C356&ssl=1","keywords":["deny access"],"articleSection":["Apache"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/","url":"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/","name":"Apache Deny Access to URL, Files & Directory - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/restrict-access-apache.png?fit=840%2C356&ssl=1","datePublished":"2020-12-17T07:29:28+00:00","dateModified":"2025-10-02T05:21:52+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Sometimes you may need to restrict access to URL, file or directory. Here is how to deny access to URL, Files & Directory in Apache.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/restrict-access-apache.png?fit=840%2C356&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/restrict-access-apache.png?fit=840%2C356&ssl=1","width":840,"height":356,"caption":"deny access in apache"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"Apache Deny Access to URL, Files &#038; Directory"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/restrict-access-apache.png?fit=840%2C356&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-IT","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/2783","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=2783"}],"version-history":[{"count":16,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/2783\/revisions"}],"predecessor-version":[{"id":9700,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/2783\/revisions\/9700"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/2788"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=2783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=2783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=2783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}