Reputation:
I want to rewrite www.example.com
or www.example.com/
or www.example.com/index.php
to /home/
.
I tried this but I'm getting Internal Server Error
:
RewriteCond %{REQUEST_URI} !^/$
RewriteRule ^(.*)$ /home/$1 [L]
What am I doing wrong?
Upvotes: 1
Views: 511
Reputation: 7476
Try below rule,
RewriteEngine On
RewriteCond %{REQUEST_URI} ^(/|/index.php)$
RewriteRule ^ home/ [L]
Upvotes: 1
Reputation: 785156
You can use this rule as your very first rule in site root .htaccess:
RewriteEngine On
RewriteEngine ^/?(index\.php)?$ /home/ [L,NC]
Upvotes: 0