2008-05-18 21:16 |
mmburke
Matthew M. Burke <mmburke at 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
2008-05-18 21:19 |
jnwhiteh
Jim Whitehead II <jnwhiteh at 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
2008-05-19 16:04 |
yuri
Yuri Takhteyev <yuri at sims.berkeley.edu>
> 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 NICE_URL to whatever you want to come before the node name, and most URLs would be constructed as NICE_URL..node_name. It's up to you, however, to make sure that node_name 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 NICE_URL altogether and just not add ?p= to BASE_URL 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/
2008-05-21 00:09 |
mmburke
Matthew M. Burke <mmburke at 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
2008-05-21 00:39 |
yuri
Yuri Takhteyev <yuri at sims.berkeley.edu>
> 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/
2008-05-21 01:17 |
mmburke
Matthew M. Burke <mmburke at 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