Thread: mod_rewrite
View Single Post
Old 04-02-2008, 05:42 PM   #3 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

You'll probably want something more along the lines of:
Code:
<IfModule mod_rewrite.c>
	RewriteEngine On

	# Redirect all requests to index.php
	# if file doesn't exist
	# and directory doesn't exist
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^index/(.*)$ index.php/$1 [L]

</IfModule>
The RewriteCond lines make sure that the rewriting only happens if the URL is not otherwise normally accessible (useful for images, CSS, etc.). The RewriteRule line rewrites URIs starting with index/ as you requested.
Salathe is offline  
Reply With Quote