]> sipb.mit.edu Git - ikiwiki.git/blob - doc/forum/Forward_slashes_being_escaped_as_252F.mdwn
(no commit message)
[ikiwiki.git] / doc / forum / Forward_slashes_being_escaped_as_252F.mdwn
1 When I try to edit a page that has a forward slash in the URL, I get "Error:
2 bad page name". I think the problem is because the forward slash is escaped as
3 `%252F` instead of `%2F`.
4
5 For example, if I go to `http://ciffer.net/~svend/tech/hosts/` and click Edit,
6 I am sent to a page with the URL
7 `http://ciffer.net/~svend/ikiwiki.cgi?page=tech%252Fhosts&do=edit`.
8
9 I am running ikiwiki 3.20100504~bpo50+1 on Debian Lenny.
10
11
12 > But on your page, the Edit link is escaped normally and correctly (using %2F).
13 > Look at the page source!
14
15 > The problem is that your web server is forcing a hard (302) redirect
16 > to the doubly-escaped url. In wireshark I see your web server send back:
17
18         HTTP/1.1 302 Found\r\n
19         Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch
20         Location: http://ciffer.net/~svend/ikiwiki.cgi?page=tech%252Fhosts&do=edit
21
22 > You'll need to investigate why your web server is doing that... --[[Joey]]
23
24 >> Thanks for pointing me in the right direction. I have the following redirect
25 >> in my Apache config.
26
27         RewriteEngine on
28         RewriteCond %{HTTP_HOST} ^www\.ciffer\.net$
29         RewriteRule /(.*) http://ciffer.net/$1 [L,R]
30
31 >> and my ikiwiki url setting contained `www.ciffer.net`, which was causing the
32 >> redirect. Correcting the url fixed the problem. I'm still not sure why
33 >> Apache was mangling the URL. --[[Svend]]