SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
Jun 9, 2002, 14:12 #1
- Join Date
- Jun 2002
- Location
- Brazil
- Posts
- 149
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Apache - Virtual Directory Structure
Hello!
I'm using this apache config to creating a virtual directory structure:
Code:<VirtualHost myhost> ServerAdmin webmaster@myhost ServerName yourhost DocumentRoot "/my/web/path/site.php" </VirtualHost>
Is there any mod_rewrite rule, cond or another solutions to resolve this problem???
Kindest Regards,
marcoBR
-
Jun 11, 2002, 20:41 #2
- Join Date
- Aug 2001
- Location
- Los Angeles, California
- Posts
- 15
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Are you declaring a php file as the DocumentRoot or is that a directory?
If it's a file, why for the love of mike would you do that? It's an interesting concept but it seems to already be making your life miserable. But if it's really what you want to do, I would be very interested in the the logic behind it.
You should be able to use Alias directive to get to your regular directories
Alias /images/ /path/to/my/images"Decisions should be made in the space of seven breaths."
Karyn Ulriksen
Valkaryn Internet Group
http://www.valkaryn.net
-
Jun 11, 2002, 22:44 #3
- Join Date
- Jun 2002
- Location
- Brazil
- Posts
- 149
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks valkary
My site.php script parse and execute a mysql query based on the REQUEST_URI request, eg:
http://myhost/soccer/article/worldcup/2/
Did you understand now???
Regards,
marcoBR
-
Jun 12, 2002, 05:39 #4
- Join Date
- Jul 1999
- Location
- Derbyshire, UK
- Posts
- 4,411
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If you set your document root to the path of a file you'll never be able to get it to go anywhere else but that file, the document root should be a directory.
Karl Austin :: Profile :: KDA Web Services Ltd.
Business Web Hosting :: Managed Dedicated Hosting
Call 0800 542 9764 today and ask how we can help your business grow.
-
Jun 12, 2002, 22:00 #5
- Join Date
- Jun 2002
- Location
- .chicago.il.us
- Posts
- 957
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
By mapping the root to a file, you are pushing all subsequent requests through that file (script).
One possible suggestion, though a bit drawn-out and difficult, might be to check for ^/cgi-bin/(.+) in $REQUEST_URI and then call the file from within the script, perhaps using system(). Or for /images, read in the image file and write it to the browser with the correct content-type. This sounds like more work than it's worth, however.
Personally, I think I would take the somewhat lengthier (than current) road, and create individual files for the root documents (eg: soccer) and then in .htaccess set up mappings such as:
<Files soccer>
ForceType application/x-httpd-php
</Files>
Then, rename site.php to index.php. From there, make each file parse the remainder of the REQUEST_URI for the appropriate action. Or for that matter, have all the files be something as simple as:
<?php
require('index.php');
?>
Bookmarks