Alon Gubkin
Alon Gubkin

Reputation: 57119

Url Rewriting Help

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.

Upvotes: 0

Views: 137

Answers (2)

user197920
user197920

Reputation:

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

Upvotes: 0

Dominic Rodger
Dominic Rodger

Reputation: 99751

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

DirectoryIndex index.php

Upvotes: 2

Related Questions