Forum Moderators: phranque

Message Too Old, No Replies

setting site's root directory

         

webstyler

8:23 am on Jun 29, 2006 (gmt 0)

10+ Year Member



Hi

I have local more site

[localhost...]
[localhost...]
[localhost...]
[localhost...]
[localhost...]

Can I setting site's root directory with htaccess?
So i can use patyh "/images/test.gif" without problem (and other:) )

thks

coopster

5:49 pm on Jun 29, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You cannot set the DocumentRoot [httpd.apache.org] in per-directory override files (
.htaccess
) as the DocumentRoot directive specifically states that the Context [httpd.apache.org] is
server config, virtual host
, which means that the directive may be used in the server configuration files (e.g.,
httpd.conf
), but not within any
<VirtualHost>
or
<Directory>
containers. It is not allowed in
.htaccess
files at all.

webstyler

6:28 am on Jul 3, 2006 (gmt 0)

10+ Year Member



Hi, I have try this on .conf

<VirtualHost 127.0.0.2>
ServerAdmin webmaster@host.foo.com
DocumentRoot c:/Web/mydir/dirsite
ServerName site512
#ErrorLog logs/host.foo.com-error_log
#TransferLog logs/host.foo.com-access_log
</VirtualHost>

if I write 127.0.0.2 I see site
if I write [site512...] not ..
why?

I need to use this with name

thksks

coopster

5:21 pm on Jul 4, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You need something to convert the domain name to an IP address. Usually a DNS server does this for you but you can spoof your local machine by editing it's local
hosts
file.