response
[ikiwiki] / doc / todo / want_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both.mdwn
1 It looks like all links in websites are absolute paths, this has some limitations:
2
3 * If connecting to website via https://... all links will take you back to http://
4 * Makes it harder to mirror website via HTML version, as all links have to be updated.
5
6 It would be good if relative paths could be used instead, so the transport method isn't changed unless specifically requested.
7
8 -- Brian May
9
10 > Er, which absolute links are you talking about? If you view the source
11 > to this page, you'll find links such as "../favicon.ico", "../style.css",
12 > "../../", and "../". The only absolute links are to CGIs and the w3c DTD.
13 > --[[Joey]]
14
15 >> The problem is within the CGI script. The links within the HTML page are all
16 >> absolute, including links to the css file. Having a http links within a HTML
17 >> page retrieved using https upset most browsers (I think). Also if I push cancel
18 >> on the edit page in https, I end up at at http page. -- Brian May
19
20 >>> Ikiwiki does not hardcode http links anywhere. If you don't want
21 >>> it to use such links, change your configuration to use https
22 >>> consistently. --[[Joey]]
23
24 Errr... That is not a solution, that is a work around. ikiwiki does not hard
25 code the absolute paths, but absolute paths are hard coded in the configuration
26 file. If you want to serve your website so that the majority of users can see
27 it as http, including in rss feeds (this allows proxy caches to cache the
28 contents and has reduced load requirements), but editing is done via https for
29 increased security, it is not possible. I have some ideas how this can be
30 implemented (as ikiwiki has the absolute path to the CGI script and the
31 absolute path to the destination, it should be possible to generate a relative
32 path from one to the other), although some minor issues still need to be
33 resolved. -- Brian May
34
35 I noticed the links to the images on <http://ikiwiki.info/recentchanges/> are
36 also absolute, that is <http://ikiwiki.info/wikiicons/diff.png>; this seems
37 surprising, as the change.tmpl file uses &lt;TMPL_VAR BASEURL&gt; which seems
38 to do the right thing in page.tmpl, but not for change.tmpl. Where is BASEURL
39 set? -- Brian May
40
41 > The use of an absolute baseurl in change.tmpl is a special case. --[[Joey]]
42
43 So I'm facing this same issue. I have a wiki which needs to be accessed on
44 three different URLs(!) and the hard coding of the URL from the setup file is
45 becoming a problem for me. Is there anything I can do here? --[[Perry]]
46
47 > I remain puzzled by the problem that Brian is discussing. I don't see
48 > why you can't just set the cgiurl and url to a https url, and serve
49 > the site using both http and https.
50
51 > Just for example, <https://kitenet.net/> is an ikiwiki, and it is accessible
52 > via https or http, and if you use https, links will remain on https (except
53 > for links using the cgi, which I could fix by changing the cgiurl to https).
54
55 > I think it's possible ikiwiki used to have some
56 > absolute urls that have been fixed since Brian filed the bug. --[[Joey]]  
57
58 [[wishlist]]