Forum Moderators: phranque
I have a folder called "blah" and I want it to become the DocumentRoot i.e.
[localhost...] --> C:\AppServ\www\blah
But I want to do this through .htaccess files only. Is this possible? I am running on windows xp and tried the following code in a file on the www folder:
DocumentRoot C:\AppServ\www\model
But I just get a 500 internal server error. Any ideas? Thanks in advance :)
Context:server config, virtual host
ie. DocumentRoot cannot be used in .htaccess, so the short answer to your question is: no. :)
Could you explain in more broad terms what you need to do? You may be able to cook something up with mod_rewrite.
<img src="/images/logo.gif">
Which is annoying because I have to change them to this:
<img src="/blah/images/logo.gif">
So I wondered what is they easiest way I could switch over the document root without going through the httpd.conf file..?
The URL shown in links on page will be www.domain.com/somefile.ext
User requests www.domain.com/somefile.ext and then a rewrite translates that to get the file from the /whatever/somefile.ext internal filepath.
Direct requests to the /whatever/ folder need to be either blocked, or redirected back to the correct root URL.
So, for completeness, there is a rewrite and a redirect involved.