vismay02 wrote: I hope you understood.
Hardly - but I might got it. What you call "virtual server" (above you called it "virtualhost", what is competely wrong!) seems to be the same thing what is called "port forwarding" in other routers.
I think, that you installed your problematic application locally onto your (Xampp?) server, and you applied eithe "localhost" or the local IP (like 192.168.x.x) as server name in the installation routine (most applications require a server name, an IP or similar in the installation dialog). At next, probably your application installs a .htaccess file which does a redirect or rewrite, which routes to that server name you applied in the installation. Maybe a redirect happens without .htaccess, but within the PHP code.
If this is the case (what is very common for many CMS like wordpress, joomla etc.), this finally leads to the problem, that the target IP is a LAN IP (or "localhost"), which is unknown in the scope if you connect from outside your LAN. That finally results in "cannot connect to server". You may check the access_log (and also error_log) of your server in order to find out, if redirects are happening and if they succeed or not.
The general solution to that problem is, if you are planning to connect to your application from outer Internet, do NOT provide the LAN IP as server name, provide the external IP instead already at installation time. In an existing installation you might be successfull to edit any kind of config file (for wordpress it is wp-config.php), where you can change the server name also after the installation.