Forum Moderators: phranque

Message Too Old, No Replies

Help with apache/php webserver directory mapping

         

faded_again

10:40 pm on Aug 11, 2011 (gmt 0)

10+ Year Member



Hi there,

I want to serve files to my root domain from a subfolder on my web server, without showing the folder name.

Eg.

Loading [domain.com...] serves files from the /subfolder/ directory on the webserver instead of the root directory, but the "subfolder" folder name is not shown.

Is this possible? Can anybody provide some code to help me achieve this?

Thanks in advance for your help.

lucy24

11:26 pm on Aug 11, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is this possible?

Yes, it's done with a rewrite.

Can anybody provide some code to help me achieve this?

Is anybody able to? Yes again. Is anybody willing to? Not unless you find someone in a phenomenally good mood. Otherwise everyone is going to sit back and make you do some preliminary work yourself :)

brotherhood of LAN

12:32 am on Aug 12, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome, faded_again

DocumentRoot helps Apache map your domains to a physical folder on the server. See [httpd.apache.org...]

Here's some sample code from my own apache2.conf, which maps example.com and www.example.com to /var/www/myfolder


<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot "/var/www/myfolder"
ErrorLog "/var/logs/example.com.error.log"
CustomLog "/var/logs/example.com.custom.log" combined
</VirtualHost>

faded_again

9:49 pm on Aug 14, 2011 (gmt 0)

10+ Year Member



brotherhood of LAN: thank you very much