# .htaccess rant

**URL:** <https://forum.kirupa.com/t/htaccess-rant/261195>\
**Category:** random\
**Created:** [May 24, 2008, 3:22am UTC](https://forum.kirupa.com/t/htaccess-rant/261195 "2008-05-24T03:22:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)\
**Post date:** [May 24, 2008, 3:22am UTC](https://forum.kirupa.com/t/htaccess-rant/261195/1 "2008-05-24T03:22:50Z")

</div>

Here’s my small dilemma.

I need to write a file via php that is only accessible from files on the same server.

ie; a swf/php file on the same server can access that file, and write that file - but noone and nothing else.

chmod won’t really do anything for me here, since the “owner” won’t really be apache. (webserver).

I was thinking this though, in .htaccess … would that work?

```auto

<Files securefile.pxx>
    order deny,allow
    deny from all
    allow from xx.xx.xx.xx
</Files>

```

Since apache will always be allowed it’s own content, wouldn’t that fly?

---

<div class="post-metadata">

**Author:** ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)\
**Post date:** [May 24, 2008, 3:37am UTC](https://forum.kirupa.com/t/htaccess-rant/261195/2 "2008-05-24T03:37:36Z")

</div>

Sorry to post a question I could answer myself.

It works fine. Can delete this thread I guess ; )
