ramo
ramo

Reputation: 955

Redirect index.php to root

I've done this before, it was like a line of code. Now when I look for it, it's all 5-10 lines for just redirecting index.php to root (/) in .htaccess.

What's the best way to do this?

Upvotes: 2

Views: 1011

Answers (2)

Ansipants
Ansipants

Reputation: 35

might it be something like this that you are looking for:

Redirect 301 /index.php http://www.yoursite.com/folder/

Upvotes: 1

Marcos Aguayo
Marcos Aguayo

Reputation: 7170

This code works for me

RewriteCond %{THE_REQUEST} ^.*/index.php 
RewriteRule ^(.*)index.php$ /$1 [R=301,L] 

Upvotes: 4

Related Questions