Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #179 (closed defect: wontfix)

Opened 13 years ago

Last modified 8 years ago

URL redirection doesn't work for hosts other than "localhost:8080".

Reported by: Jorge Godoy <jgodoy@…> Owned by: anonymous
Priority: normal Milestone: 0.9
Component: TurboGears Version:
Severity: normal Keywords:


Today when I issue a raise cherrypy.HTTPRedirect(turbogears.url("/relative_url/")) it redirects me to " http://localhost:8080/relative_url" instead of " http://my.site.com/relative_url". If I hardcode the URL and use cherrypy.HTTPRedirect(" http://my.site.com/relative_url/") it works perfectly, but then I loose the ability of "moving" things around easily (well, I need a "sed" script to fix this for the production server, but that's just it...).

This is with SVN r.258.

I've also tried changing

baseUrlFilter.on=True baseUrlFilter.baseUrl = " http://my.site.com"

and again cherrypy.HTTPRedirect(turbogears.url("/relative_url/")) doesn't work. It makes the URL looks like:  http://my.syte.com/http://my.site.com/relative_url/.

Change History

comment:1 Changed 13 years ago by arnarbi@…

As detailed in this thread:  http://groups.google.com/group/turbogears/browse_thread/thread/884d87b1600e591f/88944e5ee8ebfa26

I had this problem, getting the following exception:

Traceback (most recent call last):
line 271, in run
line 497, in main
   page_handler, object_path, virtual_path = mapPathToObject(path)
line 748, in mapPathToObject
   raise cherrypy.NotFound(path)
NotFound: 404: The path '/timaskraning/' was not found.

I found a workaround for this problem by adding a VirtualPathFilter? to my controller:

class VirtualPathFilter(object):
  def beforeRequestBody(self):
     if cherrypy.config.get("virtualPathFilter.on", False):
        prefix = cherrypy.config.get("virtualPathFilter.prefix", "")
        if prefix:
           path = cherrypy.request.path
           if path == prefix:
              path = "/"
           elif path.startswith(prefix):
              path = path[len(prefix):]
           cherrypy.request.path = path

with the following config:

virtualPathFilter.on = True
virtualPathFilter.prefix = "/timaskraning"

The last line makes std.url() behave properly in templates.


comment:2 Changed 13 years ago by SuperJared <jared.kuolt@…>

I cannot reproduce this.

Also, server.webpath works differently as of [340]. It eliminates the need for the VirtualPathFilter?.

comment:3 Changed 13 years ago by godoy

  • Status changed from new to closed
  • Resolution set to wontfix

I'm closing this for now since it is a non-issue after using mod_proxy to deploy the application and I don't have time to test it now. It probably works today since a lot has been done and we're almost 1000 revisions ahead of when the bug was open.

Note: See TracTickets for help on using tickets.