Page 1 of 1

how to redirect localhost to localhost:1337

PostPosted: 29. October 2014 11:51
by talpazzo
Hi everybody,
I have a little problem with a plugin I'm using on Wordpress on my localhost.
Everything work great except this plugin.

My website it's under "http://localhost:1337/mywebsite" and when I'm trying to use this plugin (it's an import plugin for importing XML) it opens "http://localhost/" and the port it's missing, so nothing will work and I have to put manually ":1337".

There is a way to always redirect "http://localhost/" to "http://localhost:1337/"?
Should I do something else to fix this problem?

Thank you very much, Diego

Re: how to redirect localhost to localhost:1337

PostPosted: 29. October 2014 12:33
by Altrea
You should ask the developer of this specific plugin.
In many cases it is a simple configuration issue.

Re: how to redirect localhost to localhost:1337

PostPosted: 29. October 2014 12:36
by Nobbie
talpazzo wrote:There is a way to always redirect "http://localhost/" to "http://localhost:1337/"?


No, as http://localhost does not reach your Apache anyway, so "nobody" can change Port 80 to 1337. Nobody is listening to Port 80 (or simply the wrong software is listening). This is one of the major disadvantages of using a different Port then 80 for Apache (i do not recommend that).

You may be lucky if "localhost" is not hardcoded in the WordPress plugin, but instead taken from Server Variables of HTTP Request. Be sure to set "ServerName" in http.conf to "localhost:1337" instead of only "localhost". Change that (if necessary), restart Apache and try again - maybe WordPress will address now correctly to localhost:1337. If not, there is no solution other than editing the source code of WordPress and/or the Plugin.

Also, if you were asked for the Domain Name in WordPress installation, you also MUST enter localhost:1337 instead of only localhost.

Re: how to redirect localhost to localhost:1337

PostPosted: 29. October 2014 15:52
by talpazzo
Nobbie wrote:No, as http://localhost does not reach your Apache anyway, so "nobody" can change Port 80 to 1337. Nobody is listening to Port 80 (or simply the wrong software is listening). This is one of the major disadvantages of using a different Port then 80 for Apache (i do not recommend that).


Thank you Nobbie,
I changed everything back to 80 and modify the programs port using 80 so there is not conflict.
Now my website runs under "http://localhost/mywebsite" and no problem with the plugin.

Have a nice day, Diego