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?
Tagged:
Tagged:

Comments

  • Redirect index.html to url
    RewriteRule ^/index\.html$ http://cyberpanel.net/? [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, 123.123.123.123 on www.example.com. So if I enter the IP address in the browser, I am redirected to this domain
  • On this file
    /usr/local/lsws/conf/httpd_config.conf
    First find listener Default {

    Under this directive append map Example *

    Then, edit the Example vhost conf located at:
    /usr/local/lsws/conf/vhosts/Example/vhconf.conf
    and append:
    rewrite  {
    enable 1
    logLevel 9
    RewriteCond %{HTTP_USER_AGENT} ^NameOfBadRobot
    RewriteRule ^/nospider/ - [F]

    RewriteRule ^/$ http://cyberpanel.net/? [L,R=301]
    }
    Remove any other rewrite related directives if any, and replace cyberpanel.net with the domain.
Sign In or Register to comment.
Support CyberPanel CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion