How to redirect index.html to url ? How to redirect IP to domain ?

How to redirect index.html to url? How to redirect IP to domain?

Redirect index.html to url

RewriteRule ^/index\\.html$ [L,R=301]

Give an example of your second question.

Thank you for the help, it works. As for the second question, I need to redirect the IP address of my server to the domain. For example, on So if I enter the IP address in the browser, I am redirected to this domain

On this file


First find listener Default {`

Under this directive append map Example *`

Then, edit the Example vhost conf located at:


and append:

rewrite  {
  enable                  1
  logLevel                9
RewriteCond %{HTTP_USER_AGENT}  ^NameOfBadRobot
RewriteRule ^/nospider/         -   [F]

RewriteRule ^/$ [L,R=301]

Remove any other rewrite related directives if any, and replace with the domain.