views:

69

answers:

1

hi,

im pulling my hair out.

im utilising mod_rewrite to run through index.php if %{REQUEST_URI} isnt an existing document:

#Any request (page) which doesnt exist (item pages, special urls, categories etc)
#get routed through urlparse, where PHP takes over nicely
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule (.*) urlparse.php?url=$1 [L]

taking this into account, i want a rule BEFORE this one which stipulates:

if %{REQUEST_URI} is empty then pretend it is index.php

my understanding is for a url like

http://www.server.com/

then %{REQUEST_URI} is "" (an empty string), verses

http://www.server.com/something/whatever

where %{REQUEST_URI} is "something/whatever".

thanks for any help you guys can give.

A: 

Simply:

RewriteRule ^$ index.php
Gumbo
thankyou muchly. i had to add [L] to the rule to force apache to not parse the other rules, but youve relieved my stress-headache.
mykel