You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Fabricio Gouvea <fa...@gmail.com> on 2011/01/28 22:24:39 UTC

[users@httpd] Apache2 replies with 301 moved permanently when non-default port 80 is used

Hi,
My ports.conf has:
NameVirtualHost 10.77.0.77:8080
Listen 8080

and sites-available/default has:
<VirtualHost 10.77.0.77:8080>
        ServerName mysite.dyndns.org:8080
        ServerAdmin webmaster@localhost
        DocumentRoot /home/ubuntu/wordpress
</VirtualHost>

But when I try to connect, either with 10.77.0.77:8080 or
mysite.dyndns.org:8080, by looking at the wireshark trace, I see Apache
replying with a "301 moved permanently" and redirects to 10.77.0.77 or
mysite.dyndns.org (without the 8080 port!).

If I add:
Listen 80
....
<VirtualHost *:80>
        ServerName mysite.dyndns.org
        ServerAdmin webmaster@localhost
        DocumentRoot /home/ubuntu/wordpress
</VirtualHost>

Then everything works! But I can`t have that working only on default 80
because my ISP is blocking it.

I tried a bunch of different configurations with multiple combinations of:
NameVirtualHost and VirtualHost with wild card *
NameVirtualHost and VirtualHost with mysite.dyndns.org
ServerName without the port
No ServerName (and a proper entry on etc/hosts)

I'm about the get into the code!
Please help!

Re: [users@httpd] Apache2 replies with 301 moved permanently when non-default port 80 is used

Posted by Fabricio Gouvea <fa...@gmail.com>.
Thank you Eric,
It was not my config, nor the htaccess. But your comment made me realized
that would probably be an issue with wordPress (yes, I didn't think it was
relevant! sorry).
And it was! Wordpress was the one redirecting. I reinstallled it using the
port number as the site URL and it now working.
Thank you very much!

On Fri, Jan 28, 2011 at 7:57 PM, Eric Covener <co...@gmail.com> wrote:

> Look for Redirects elsehwere in your config, or for htaccess in your
> documentroot.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] Apache2 replies with 301 moved permanently when non-default port 80 is used

Posted by Eric Covener <co...@gmail.com>.
Look for Redirects elsehwere in your config, or for htaccess in your
documentroot.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org