Path: csiph.com!usenet.pasdenom.info!news.albasani.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.033 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'subject:: [': 0.04; 'pages.': 0.09; 'rewrite': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; '24,': 0.16; '80.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'referencing': 0.16; 'slash': 0.16; 'sat,': 0.16; 'wrote:': 0.18; '(not': 0.18; 'bit': 0.19; 'app': 0.19; 'subject:] ': 0.20; 'seems': 0.21; 'cc:addr:python.org': 0.22; 'css,': 0.24; 'days,': 0.24; 'necessary.': 0.24; 'server.': 0.24; 'cc:2**0': 0.24; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'absolute': 0.30; 'relative': 0.30; 'strongly': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'went': 0.31; 'code': 0.31; 'requests': 0.31; 'file': 0.32; 'this.': 0.32; 'maintaining': 0.32; 'trouble': 0.34; 'something': 0.35; 'test': 0.35; 'received:google.com': 0.35; 'doing': 0.36; 'same.': 0.38; 'rather': 0.38; 'little': 0.38; 'system.': 0.39; 'even': 0.60; 'browser': 0.61; 'back': 0.62; 'times': 0.62; 'subject:. ': 0.67; 'default': 0.69; 'fact,': 0.69; 'incoming': 0.72; 'links,': 0.74; '2015': 0.84; 'bare': 0.84; 'etc,': 0.84; '1:47': 0.91; 'edwards': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=tRdcpA9woydnRQ2FVzG8xZjz8xWw45X/k39Q3qK8AF4=; b=NibmaIdwfJlGrrJC5TWltzDIKOW72RL5IL6IUxzTb7UjVmBFjn2BdhvKnWmfXXcCYw wVVEj/hJd7tyRxkikPlJWQRwyU2QlLnpoMrG7SRzUhB8mZMtej4HV2USn0RklBvCCKZ4 3lXlFGmU1T0VJxemDGQ7VUdxVjYd2BykAuriG+coToSKD/amaZivwyDjlGDNj9REbiEq 3Zb/pjCtq8+iE8hmNeg5/qHccu4/dZgUGQCPa4qQZaqUSU/XxD3ld9myQw8oDQnrr5iO u/tvJQbnrrmCc0Pr5ponNpcEjeeCRjHeHlWgcDW15+zc9WjoIcGoKLlUNUK/F3woxoC5 +eMg== MIME-Version: 1.0 X-Received: by 10.140.97.203 with SMTP id m69mr15602621qge.39.1422035737982; Fri, 23 Jan 2015 09:55:37 -0800 (PST) In-Reply-To: References: Date: Sat, 24 Jan 2015 04:55:37 +1100 Subject: Re: [OT] absolute vs. relative URI From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422035741 news.xs4all.nl 2908 [2001:888:2000:d::a6]:36484 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:84369 On Sat, Jan 24, 2015 at 1:47 AM, Grant Edwards wrote: > I'm maintaining a web app were the original author(s) went to a little > bit of trouble to always use absolute URIs in links in the pages. The advantage is that someone who downloads the bare page will still be referencing images, CSS, other links, etc, from the original server. The disadvantage is... exactly the same. These days, it's MUCH better to use relative links, and then let something like wget rewrite them as necessary. In fact, if all your links are relative (not even the leading slash - use ../../../ as many times as is necessary), they don't even need rewriting, and you can test your web site by just pointing your browser at the file system. The original code seems rather fragile. The port number isn't incorporated, so incoming requests on 8443 will end up going through to https:// with the default port of 443. Any other port will be sent back through 80. Strongly recommend not doing this. ChrisA