Question
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.
Solution
You'll need to set DirectoryIndex
in your .htaccess
file:
DirectoryIndex index.php
OTHER TIPS
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ index.php?q=$1 [L]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow