{"id":23391415,"url":"https://github.com/asadullah-nadeem/block-web-scraping-tools","last_synced_at":"2026-02-22T12:36:13.152Z","repository":{"id":268915245,"uuid":"905849757","full_name":"Asadullah-nadeem/Block-Web-Scraping-Tools","owner":"Asadullah-nadeem","description":"Block Web Scraping Tools using htaccess","archived":false,"fork":false,"pushed_at":"2025-01-15T16:44:20.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T11:20:09.611Z","etag":null,"topics":["htaccess"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Asadullah-nadeem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-19T16:38:46.000Z","updated_at":"2025-01-15T22:03:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"6cdc1b9f-0e20-4431-9f9e-5f091eab081c","html_url":"https://github.com/Asadullah-nadeem/Block-Web-Scraping-Tools","commit_stats":null,"previous_names":["asadullah-nadeem/block-web-scraping-tools"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asadullah-nadeem%2FBlock-Web-Scraping-Tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asadullah-nadeem%2FBlock-Web-Scraping-Tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asadullah-nadeem%2FBlock-Web-Scraping-Tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asadullah-nadeem%2FBlock-Web-Scraping-Tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Asadullah-nadeem","download_url":"https://codeload.github.com/Asadullah-nadeem/Block-Web-Scraping-Tools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247866129,"owners_count":21009238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["htaccess"],"created_at":"2024-12-22T04:17:22.054Z","updated_at":"2025-10-23T18:32:05.692Z","avatar_url":"https://github.com/Asadullah-nadeem.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Block Specific User Agents and Enhance Website Security in `.htaccess`\n\nThis `.htaccess` snippet is designed to block specific user agents commonly associated with web scraping, unauthorized access attempts, and direct IP access. It also includes protection for the `.htaccess` file itself to prevent unauthorized viewing or modification.\n\n## Rules Description\n\n1. **Enable Rewrite Engine**: Activates the mod_rewrite module.\n2. **Block User Agents**:\n   - Prevents access from tools and bots like:\n     - HTTrack\n     - wget\n     - curl\n     - libwww\n     - python\n     - WinHTTrack\n     - Nmap Scripting Engine\n     - Go-http-client\n     - apachebench\n     - Any User-Agent containing \"crawler\", \"spider\", or \"scanner\".\n3. **Block Direct IP Access**:\n   - Ensures the website is only accessible via the domain name (e.g., `yourwebsite.com`).\n4. **Protect `.htaccess`**:\n   - Prevents unauthorized access to the `.htaccess` file itself.\n\n## Usage\n\n1. **Copy and Paste the Snippet**  \n   Add the following code to the `.htaccess` file located in the root directory of your website:\n\n   ```apache\n   # Enable Rewrite Engine\n   RewriteEngine On\n\n   # Block specific user agents\n   RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR]\n   RewriteCond %{HTTP_USER_AGENT} wget [NC,OR]\n   RewriteCond %{HTTP_USER_AGENT} curl [NC,OR]\n   RewriteCond %{HTTP_USER_AGENT} libwww [NC,OR]\n   RewriteCond %{HTTP_USER_AGENT} python [NC,OR]\n   RewriteCond %{HTTP_USER_AGENT} WinHTTrack [NC,OR]\n   RewriteCond %{HTTP_USER_AGENT} \"Nmap Scripting Engine\" [NC,OR]\n   RewriteCond %{HTTP_USER_AGENT} Go-http-client [NC,OR]\n   RewriteCond %{HTTP_USER_AGENT} apachebench [NC,OR]\n   RewriteCond %{HTTP_USER_AGENT} ^.*(crawler|spider|scanner).* [NC]\n   RewriteRule .* - [F,L]\n\n   \n   # Block direct IP access\n   RewriteCond %{HTTP_HOST} !^yourwebsite\\.com [NC]\n   RewriteRule .* - [F,L]\n\n   # Protect .htaccess file\n   \u003cFiles \".htaccess\"\u003e\n     Order Allow,Deny\n     Deny from all\n   \u003c/Files\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasadullah-nadeem%2Fblock-web-scraping-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasadullah-nadeem%2Fblock-web-scraping-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasadullah-nadeem%2Fblock-web-scraping-tools/lists"}