Changeset 6240
- Timestamp:
- Nov 28, 2007, 11:21:02 AM (16 years ago)
- Location:
- trunk/trac
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/trac/env.py
r6232 r6240 82 82 83 83 base_url = Option('trac', 'base_url', '', 84 """Base URL of the Trac deployment. 85 86 In most configurations, Trac will automatically reconstruct the URL 87 that is used to access it automatically. However, in more complex 88 setups, usually involving running Trac behind a HTTP proxy, you may 89 need to use this option to force Trac to use the correct URL.""") 84 """Reference URL for the Trac deployment. 85 86 This is the base URL that will be used when producing documents that 87 will be used outside of the web browsing context, like for example 88 when inserting URLs pointing to Trac resources in notification 89 e-mails.""") 90 91 base_url_for_redirect = BoolOption('trac', 'use_base_url_for_redirect', 92 False, 93 """Optionally use `[trac] base_url` for redirects. 94 95 In some configurations, usually involving running Trac behind a HTTP 96 proxy, Trac can't automatically reconstruct the URL that is used to 97 access it. You may need to use this option to force Trac to use the 98 `base_url` setting also for redirects. This introduces the obvious 99 limitation that this environment will only be usable when accessible 100 from that URL, as redirects are frequently used.""") 90 101 91 102 project_name = Option('project', 'name', 'My Project', -
trunk/trac/web/api.py
r5945 r6240 277 277 self.send_response(status) 278 278 if not url.startswith('http://') and not url.startswith('https://'): 279 # Make sure the URL is absolute, honor base_url for 280 # scheme and host if present 279 # Make sure the URL is absolute 281 280 scheme, host = urlparse.urlparse(self.base_url)[:2] 282 url = urlparse.urlunparse((scheme, host, url, None, None, None)) 281 url = urlparse.urlunparse((scheme, host, url, None, None, None)) 283 282 284 283 self.send_header('Location', url) -
trunk/trac/web/main.py
r6139 r6240 372 372 try: 373 373 env = open_environment(env_path, use_cache=not run_once) 374 if env.base_url :374 if env.base_url_for_redirect: 375 375 environ['trac.base_url'] = env.base_url 376 376 except TracError, e:
Note:
See TracChangeset
for help on using the changeset viewer.