title: How Can I forward traffic to the websites IP to the websites domain? (Bitnami/AWS)
body: <p>For example, someone goes to <a href="http://192.168.1.1" rel="nofollow noreferrer">http://192.168.1.1</a> and I want them to be forwarded instantly to <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a>.</p>
  <p>I have a bitnami WordPress instance and you can access it via the IP AND domain name. I have edited the wp-config.php commenting out</p>
  <pre><code>//define( 'WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/' );
  //define( 'WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/' );
  </code></pre>
  <p>and added</p>
  <pre><code>define('WP_HOME', 'https://example.com/');
  define('WP_SITEURL', 'https://example.com/');
  </code></pre>
  <p>BUT you can still access and use the site via the IP address. I want it so if someone accesses the site via the IP it redirects them to the <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a></p>
  <p>I have tried to edit the .htaccess BUT any changes get instantly removed upon upload.</p>