Qback
Qback

Reputation: 4918

Redirect extends url instead of changing it

Let's say that on mysite.com/my_view/ I can log into my system.

In development everything was fine. In production I end with mysite.com/my_view/mysite.com/adminin my url bar in browser. :(

My "log in" code looks like:

def my_view(request):
    domain="mysite.com"
    return redirect("http://"+domain+"/admin/")

Upvotes: 0

Views: 71

Answers (1)

Jahongir Rahmonov
Jahongir Rahmonov

Reputation: 13763

I don't think it has to do with your code. It should be either DNS name provider or your server.

My guess is that when registering your domain name, you submitted a relative path, like this:

yoursite.com

When you should have done this:

http://yoursite.com

Hope it helps!

Upvotes: 1

Related Questions