# Apache System Variables

**URL:** https://forum.kirupa.com/t/apache-system-variables/182600
**Category:** programming
**Created:** [March 19, 2006, 10:50pm UTC](https://forum.kirupa.com/t/apache-system-variables/182600 "2006-03-19T22:50:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![morse](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@morse](https://forum.kirupa.com/u/morse)
#### Post date: [March 19, 2006, 10:50pm UTC](https://forum.kirupa.com/t/apache-system-variables/182600/1 "2006-03-19T22:50:18Z")

</div>

Heya folks. Anybody know an Apache server variable that will return either the script’s current directory or the absolute address of the directory the script is in?

Example: if my .htaccess file is in [http://site.com/dir3/](http://site.com/dir3/), I need a variable that returns either /dir3/ or dir3/ or dir3 or [http://site.com/dir3/](http://site.com/dir3/)

Any ideas?

---

<div class="post-metadata">

### Author: ![morse](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@morse](https://forum.kirupa.com/u/morse)
#### Post date: [March 20, 2006, 5:30am UTC](https://forum.kirupa.com/t/apache-system-variables/182600/2 "2006-03-20T05:30:10Z")

</div>

I think there is a misconfiguration of Apache Virtual Host, and that’s why things aren’t working out how I need them…
