title: Form that sends post request to NodeJS works locally but not on server
body: <p>I made a form using html which when submitted sends its data to nodejs for processing. It works perfectly fine in my localhost, but when I have this code hosted on my server I get the following error: <em><strong>Not Found
  The requested URL /submit was not found on this server.</strong></em></p>
  <p>I have the following index.html form:</p>
  <pre><code>&lt;form action=&quot;http://ip/submit&quot; method=&quot;POST&quot;&gt;
          &lt;div class=&quot;position-item&quot;&gt;
            &lt;div class=&quot;item&quot;&gt;
              &lt;p&gt;What country are you from?&lt;/p&gt;
              &lt;select name=&quot;country&quot; required&gt;
                &lt;option value=&quot;Canada&quot;&gt;Canada&lt;/option&gt;
                &lt;option value=&quot;Mexico&quot;&gt;Mexico&lt;/option&gt;
              &lt;/select&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class=&quot;position-item&quot;&gt;
              &lt;div class=&quot;item&quot;&gt;
                &lt;p&gt;What state/province are you from?&lt;/p&gt;
                &lt;select name=&quot;state&quot; required&gt;
                  &lt;option value=&quot;Ontario&quot;&gt;Ontario&lt;/option&gt;
                  &lt;option value=&quot;New York&quot;&gt;New York&lt;/option&gt;
                &lt;/select&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;div class=&quot;position-item&quot;&gt;
              &lt;div class=&quot;item&quot;&gt;
                &lt;p&gt;What town/city are you from?&lt;/p&gt;
                &lt;select name=&quot;city&quot; required&gt;
                  &lt;option value=&quot;Toronto&quot;&gt;Toronto&lt;/option&gt;
                  &lt;option value=&quot;Mexico City&quot;&gt;Mexico City&lt;/option&gt;
                &lt;/select&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class=&quot;position-item&quot;&gt;
              &lt;div class=&quot;item&quot;&gt;
                &lt;p&gt;What is your native language?&lt;/p&gt;
                &lt;select name=&quot;language&quot; required&gt;
                  &lt;option value=&quot;English&quot;&gt;English&lt;/option&gt;
                  &lt;option value=&quot;Spanish&quot;&gt;Spanish&lt;/option&gt;
                &lt;/select&gt;
              &lt;/div&gt;
            &lt;/div&gt;           
         
          &lt;div class=&quot;btn-block&quot;&gt;
            &lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;
          &lt;/div&gt;
        &lt;/form&gt;
  </code></pre>
  <p>In my nodejs code index.js:</p>
  <pre><code>const express = require('express');
  const bodyParser = require('body-parser');
  const app = express();
  
  //Receive data from form submission
  app.use(bodyParser.urlencoded({ extended: true }));
  let country, state, city, language = &quot;&quot;;
  app.post('/submit', (req, res) =&gt; {
      country = res.req.body.country;
      state = res.req.body.state;
      city = res.req.body.city;
      language = res.req.body.language;
      console.log(`'${country}','${state}','${city}','${language}'`)
      
      res.redirect(&quot;http://ip/success.html&quot;)
  });
  
  const port = process.env.PORT || 3335;
  
  app.listen(port, () =&gt; {
      console.log(`Server running on port ${port}`);
  });
  </code></pre>
  <p>Any ideas as to why this is happening?</p>