Redirect 301 /index.html and index is redirecting but index.html is not redirecting?

It seems that the issue might be with the exact URL of the requested page. The Redirect 301 /index.html https://www.hostrooster.com/ directive only triggers if the URL of the requested page is exactly /index.html.

If you want to redirect both /index and /index.html to https://www.hostrooster.com/, you can use the following code in your .htaccess file:

javascript
RedirectMatch 301 ^/index(\.html)?$ https://www.hostrooster.com/

This directive uses a regular expression to match both /index and /index.html in the requested URL and redirects them to https://www.hostrooster.com/

If the redirect for https://hostrooster.com/index and https://hostrooster.com/ are working but not for https://hostrooster.com/index.html, it’s likely because the redirect rule is not matching the exact URL pattern /index.html. To handle this, you can add an additional Redirect directive for /index.html specifically:

bash
Redirect 301 /index.html https://www.hostrooster.com/
Redirect 301 /index https://www.hostrooster.com/

With these two separate rules, both /index and /index.html will be redirected to https://www.hostrooster.com/.

 

Welcome to the world of DomainRooster, where roosters (and hens) rule the roost! We're a one-stop shop for all your entrepreneurial needs, bringing together domain names and website hosting, and all the tools you need to bring your ideas to life. With our help, you'll soar to new heights and hatch great success. Think of us as your trusty sidekick, always there to lend a wing and help you navigate the sometimes-complex world of domain names and web hosting. Our team of roosters are experts in their fields and are always on hand to answer any questions and provide guidance. So why wait? Sign up today and join the ranks of the world's greatest entrepreneurs. With DomainRooster, the sky's the limit! And remember, as the saying goes, "Successful people do what unsuccessful people are not willing to do." So don't be afraid to take that leap of faith - DomainRooster is here to help you reach for the stars. Caw on!