Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


gareth41

738 posts

Ultimate Geek


#73399 13-Dec-2010 19:27
Send private message

im after a .htaccess file for apache server that will generate a 404 for a given dir unless the clients ip is in a specified list.

So anyone who tries to view the folder using a web browser will not know its there, eg it will appear as if it doesnt exist.

Create new topic
ptinson
677 posts

Ultimate Geek

Trusted

  #425709 10-Jan-2011 12:10
Send private message

gareth41: im after a .htaccess file for apache server that will generate a 404 for a given dir unless the clients ip is in a specified list.

So anyone who tries to view the folder using a web browser will not know its there, eg it will appear as if it doesnt exist.


Don't know if you got this sorted but you can do it with a rewrite rule:

RewriteEngine on
RewriteCond %{REMOTE_ADDR} !=<some ip you want to allow>
RewriteRule ^somepath - [R=404]

I would suggest reading up on mod_rewrite, and working out what you want.
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
You didn't say what version of apache so i have assumed 2.x

I would also suggest not using .htaccess if you can avoid it, your hosting situation may force you down this path though.

Paul




meat popsicle

Create new topic





News and reviews »

New Suunto Run Available in Australia and New Zealand
Posted 13-May-2025 21:00


Cricut Maker 4 Review
Posted 12-May-2025 15:18


Dynabook Launches Ultra-Light Portégé Z40L-N Copilot+PC with Self-Replaceable Battery
Posted 8-May-2025 14:08


Shopify Sidekick Gets a Major Reasoning Upgrade, Plus Free Image Generation
Posted 8-May-2025 14:03


Microsoft Introduces New Surface Copilot+ PCs
Posted 8-May-2025 13:56


D-Link A/NZ launches DWR-933M 4G+ LTE Cat6 Wi-Fi 6 Mobile Hotspot
Posted 8-May-2025 13:49


Synology Expands DiskStation Lineup with DS1825+ and DS1525+
Posted 8-May-2025 13:44


JBL Releases Next Generation Flip 7 and Charge 6
Posted 8-May-2025 13:41


Arlo Unveils All-New PoE Adapter With Enhanced Connectivity
Posted 8-May-2025 13:36


Fujifilm Instax Mini 41 Review
Posted 2-May-2025 10:12


Synology DS925+ Review
Posted 23-Apr-2025 15:00


Synology Announces DiskStation DS925+ and DX525 Expansion Unit
Posted 23-Apr-2025 10:34


JBL Tour Pro 3 Review
Posted 22-Apr-2025 16:56


Samsung 9100 Pro NVMe SSD Review
Posted 11-Apr-2025 13:11


Motorola Announces New Mid-tier Phones moto g05 and g15
Posted 4-Apr-2025 00:00



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.