From mmburke at gwu.edu Sun May 18 21:16:09 2008 From: mmburke at gwu.edu (Matthew M. Burke) Date: Sun May 18 21:23:38 2008 Subject: [Sputnik-list] Pretty URLs Message-ID: 4830B8B9.70204@gwu.edu
I'm trying to get rid of the sputnik.cgi?p= in my URLs and I'm missing a bit. I thought I had seen detailed instructions on the sputnik wiki at one point, but I cannot find them now.
Thanks,
Matt
From jnwhiteh at gmail.com Sun May 18 21:19:00 2008 From: jnwhiteh at gmail.com (Jim Whitehead II) Date: Sun May 18 21:25:54 2008 Subject: [Sputnik-list] Pretty URLs In-Reply-To: 4830B8B9.70204@gwu.edu References: 4830B8B9.70204@gwu.edu Message-ID: 5fe281d40805181619r19a3ca11w657f1646275b1b55@mail.gmail.com
On Mon, May 19, 2008 at 12:16 AM, Matthew M. Burke mmburke@gwu.edu wrote:
I'm trying to get rid of the sputnik.cgi?p= in my URLs and I'm missing a bit. I thought I had seen detailed instructions on the sputnik wiki at one point, but I cannot find them now.
You would want to change NICE_URL in the _config page, but you'll also need to enable rewrite handlers for your web server. From the Sputnik perspective, that variable is used to craft all the URLs.
What web server are you using?
- Jim
From yuri at sims.berkeley.edu Mon May 19 16:04:17 2008 From: yuri at sims.berkeley.edu (Yuri Takhteyev) Date: Mon May 19 16:11:38 2008 Subject: [Sputnik-list] Pretty URLs In-Reply-To: 5fe281d40805181619r19a3ca11w657f1646275b1b55@mail.gmail.com References: 4830B8B9.70204@gwu.edu
<5fe281d40805181619r19a3ca11w657f1646275b1b55@mail.gmail.com>
Message-ID: fa4efbc00805191104g4bc635ffu6a19da8521cd183f@mail.gmail.com
You would want to change NICE_URL in the _config page, but you'll also need to enable rewrite handlers for your web server. From the Sputnik perspective, that variable is used to craft all the URLs.
I use the ?p= format by default to not assume too much about the web server. If you want nicer URLs, you should set NICEURL to whatever you want to come before the node name, and most URLs would be constructed as NICEURL..nodename. It's up to you, however, to make sure that nodename is then mapped back onto the "p" query parameter. How you do this depends on the server. I am using Apache for the Sputnik wiki so I use mod_rewrite:
RewriteRule ^en/(.*)$ /cgi/sputnik.cgi?p=$1
For the released version and the current version in git this would affect only simple URLs that do not have any additional parameters. Mostly because at the time I thought that URLs with & but without ? would be confusing. So, we would have
/en/Sputnik
and
/en/Sputnik.edit
but instead of
/en/Sputnik&version=000009
we would have:
/cgi/sputnik.cgi?p=Saci&version=000009
This decision has not been hugely popular, so I am now leaning on using NICE_URL always if it is defined.
Note that we could theoretically get rid of NICEURL altogether and just not add ?p= to BASEURL automatically, telling the user that BASE_URL should be set to something like "http://localhost/sputnik.cgi?p=" if they are not using rewriting. I am afraid that this would be confusing at just the wrong time in the installation process. I want to make it as easy as possible to get Sputnik running, leaving nice URLs as an extra improvement that you could do later. But I am open to suggestions on this.
- yuri
-- http://sputnik.freewisdom.org/
From mmburke at gwu.edu Wed May 21 00:09:31 2008 From: mmburke at gwu.edu (Matthew M. Burke) Date: Wed May 21 00:16:36 2008 Subject: [Sputnik-list] Re: Pretty URLs In-Reply-To: E1JySNn-0007kB-TU@mail.luaforge.net References: E1JySNn-0007kB-TU@mail.luaforge.net Message-ID: 4833845B.6010207@gwu.edu
Jim, Yuri,
Thanks for the help. As often is the case, I made a small mistake in configuring the rewrite rules. Your examples helped me track the mistake down and correct it. There are two remaining issues:
1) When you use the URL: scrawl.bluedino.net there is an error message about page index not being able to handle action .html
I've fixed that by using a DirectoryIndex directive and putting Home_Page as the first choice. This feels slightly like a kludge. Any better suggestions?
2) After editing and saving a page, the URL in the browser's address bar is
http://scrawl.bluedino.net/sputnik.cgi
Is there a way of having the sputnik.cgi not show?
Thanks,
Matt
From yuri at sims.berkeley.edu Wed May 21 00:39:49 2008 From: yuri at sims.berkeley.edu (Yuri Takhteyev) Date: Wed May 21 00:47:00 2008 Subject: [Sputnik-list] Re: Pretty URLs In-Reply-To: 4833845B.6010207@gwu.edu References: E1JySNn-0007kB-TU@mail.luaforge.net 4833845B.6010207@gwu.edu Message-ID: fa4efbc00805201939l28b30876u13ecefbdd7925866@mail.gmail.com
1) When you use the URL: scrawl.bluedino.net there is an error message about page index not being able to handle action .html
If this is happening, it must be that your server is doing something strange. I am guessing that requests for "scrawl.bluedino.net" get mapped onto "scrawl.bluedino.net/index.html" or something else that ends in .html. I wouldn't know why this happens. Sputnik doesn't like being asked for foo.bar when "bar" command is not mapped onto an action. You could, if you wanted to, tell Sputnik that "html" command maps onto "wiki.show" action or, that it is the same as the "show" command (which mapps onto "wiki.show") by putting "html=show" in the "actions" field.
- yuri
2) After editing and saving a page, the URL in the browser's address bar is
http://scrawl.bluedino.net/sputnik.cgi
Is there a way of having the sputnik.cgi not show?
This has been fixed in the code repository, I believe, but not in any released versions. The git version should work without problems when using the standard filesystem storage method. (Jim's mysql sqlite3 storage backends and S?rgio's SVN backend will have to be updated for the latest changes that I checked in.) It should definitely be at least as stable as the released version in terms of not losing your data. (Which is to say, you can't easily lose data in either, since there is no "delete" operation.) And if you do find bugs, we'll be able to fix them!
The version in source repository uses the same data format as the version you are using, and if you decide for some reason to go back to the last release, you'll have that option too.
- yuri
-- http://sputnik.freewisdom.org/
From mmburke at gwu.edu Wed May 21 01:17:07 2008 From: mmburke at gwu.edu (Matthew M. Burke) Date: Wed May 21 01:24:11 2008 Subject: [Sputnik-list] Re: Pretty URLs In-Reply-To: fa4efbc00805201939l28b30876u13ecefbdd7925866@mail.gmail.com References: E1JySNn-0007kB-TU@mail.luaforge.net 4833845B.6010207@gwu.edu
<fa4efbc00805201939l28b30876u13ecefbdd7925866@mail.gmail.com>
Message-ID: 48339433.2080907@gwu.edu
Yuri Takhteyev wrote:
1) When you use the URL: scrawl.bluedino.net there is an error message about page index not being able to handle action .html
If this is happening, it must be that your server is doing something strange. I am guessing that requests for "scrawl.bluedino.net" get
I'm not sure I'd call it strange--it's the default behavior for Apache. See http://httpd.apache.org/docs/2.2/mod/mod_dir.html. But I'm happy enough with the fix I mentioned previously, so I won't worry about this.The version in source repository uses the same data format as the version you are using, and if you decide for some reason to go back to the last release, you'll have that option too.
Ok, given this and your email about permissions, the real solution is I should just git the current code. I tried that unsuccessfully once, but maybe after a good night's sleep :) I'll take another stab at it.
Thanks!
Matt