View Single Post
Old 12-11-2007, 10:22 AM   #1 (permalink)
Jinn
Lover - Protector - Teacher
 
Jinn's Avatar
 
Location: Seattle, WA
Apache, URLs and mod_rewrite

I'm trying to set up my remote hosted website (Apache) so that the URLs is useful to users and Search Engines alike, but here's my problem. myURL.com below is just an example.

I own http://www.MyURL.com (and by extension, http://myURL.com).

In the root of my site (with .htacess, robots.txt, etc) is a file called index.html. I don't want this to be what they see when they go to my website.

* If someone types in www.MyURL.com, Apache fetches index.html. How does it know to select this one? No filename was given, only a directory name.
* What I'd like it to fetch is in a subdirectory from the root, /flatpress/. It's index.php. If I manually type www.MyURL.com/flatpress, it knows to grab index.php.
Again, how does it know? I imagine it's an Apache config file I don't have access to.

I'd like http://www.MyURL.com/ and http://myURL.com/ to fetch and display the file at /flatpress/index.php while still showing the URL http://myURL.com in the browser.

I've tried to use RewriteEngine (mod_rewrite) to accomplish this, but it fails miserably.

Help?

And now that I look at it, TFP does it exactly like I want.

Typing http://tfproject.org/ is the same as http://www.tfproject.org, and both redirect to http://www.tfproject.org/tfp without showing a filename like forum.php or whatever it'd be.
__________________
"I'm typing on a computer of science, which is being sent by science wires to a little science server where you can access it. I'm not typing on a computer of philosophy or religion or whatever other thing you think can be used to understand the universe because they're a poor substitute in the role of understanding the universe which exists independent from ourselves." - Willravel

Last edited by Jinn; 12-11-2007 at 10:27 AM.. Reason: Automerged Doublepost
Jinn is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73