How to redirect index.php to root… One of the ground rules for successful SEO is to have only one url for each page. We need to combine all the Google PR and link power into one url. Typically, the index page can be accessed by both domain.com/index.php or domain.com/index.html as well as domain.com.
Where is the index.php link used on a website - Many people have a link on the home button as . This should be . So in reality, there should
never be any links into either index.php, nor index.php.
However, should such links exist, or as general good practice, there should be a redirect back to the root if ever such a link happened to exist.
Deny access to a specific page for an IP address range
HTTP to HTTPS redirect in .htaccess
HTTPS to HTTP redirect for a single page
How do I redirect index.html? How about index.php to root or home page? I recently did some website work for a local business. The business was using a static html website and we wanted to convert the site to a WordPress based platform for multiple reasons.
During the conversion, I needed to not only perform 301 redirects for
all of the currently indexed html pages, but also perform a redirect for the index.html page. This was a bit more complicated as you cannot simply perform a 301 redirect on an index page. Here is how I did it.
1How to Redirect both index.html and index.php to
Root
2How to Redirect index.html to Home Page to Root
3How to Redirect index.php to Root or Home Page
How to Redirect both index.html and index.php to Root
In the following examples, replace yoursite.com with your actual site.
First, login via an ftp client to the directory of your site.
Next, copy the .htaccess file to your desktop.
Now, using a text editor (I prefer
notepad++), open the file.
Then, at the top of the .htaccess file add the following code;
Finally, save your changes and then upload the .htaccess file to your server, replacing the old file.
From now on, any requests made to index.html or index.php depending on which
conditions and rules you used, should result in a redirect to the home page I.E. yoursite.com