tags:

views:

67

answers:

2
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteRule ^(.*)$ index.php?q=$1 [L]

This should rewrite any url to index.php?q={url}, and it's working. Anyway, http://www.domain.com/ just show a blank page. How can I rewrite / to index.php? (http://www.domain.co.il/index.php dosen't show a blank page..)

BTW: This code's redirecting and not rewriting, why is it?

Thanks.

+1  A: 

You'll need to set DirectoryIndex in your .htaccess file:

DirectoryIndex index.php
Dominic Rodger
A: 
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ index.php?q=$1 [L]
silverius