[Home]RewriteRule

UseModWiki | RecentChanges | Preferences

A query about using SlashLinks and RewriteRule to make wiki.pl handle all requests to my wiki data directory.

First off, my website's server is running Apache and I've used .htaccess before, so I know that works - though I'm not familiar with the .htaccess syntax, and all the documentation I've found is a little in-depth for me and doesn't seem to address my problem. I've been through every syntax iteration I can think of before posting here, and apologise if the problem is too off-topic. Perhaps it will be of interest to others trying to do the same thing.

I have a SlashLinks patch installed to my wiki that converts wiki.cgi?Page to wiki.cgi/Page (though the question-mark version still works, so redirecting to wiki.cgi?Page ought to work too). I don't know if the patch is affecting anything. I can do a clean install if necessary, though it'd mean rejigging a couple of other patches/tweaks I'd applied.

Here's the code given on the UseMod FAQ.

RewriteRule ^$ /HomePage [L]
RewriteRule ^(.[^/]*)$ /cgi-bin/wiki.pl?$1 [L,PT]

This, given one change from wiki.pl to wiki.cgi (my server demands the latter), does not work. Obviously it doesn't tell me why it isn't working. So I'm stuck. I've tried every other combination I can think of, as I've said, with no joy.

My wiki is at [1]. The script is located at [2]. My wiki's homepage is /Twine. What I need is a .htaccess to put in the former directory, directing all requests to wiki.cgi/Page (or wiki.cgi?Page, if that's easier). Would some kind soul please have pity?


 RewriteRule ^(.[^/]*)$ /cgi-bin/wiki.pl?$1 [L,PT]
may not work with SubPages.

You could try the following in /.htaccess:

RewriteEngine On
RewriteRule ^/twine$ /cgi-bin/wiki.pl [L, PT]
RewriteRule ^/twine/(.*)$ /cgi-bin/wiki.pl?$1 [L,PT]

Are there any helpful entries in your error_log or in the rewrite log?

-- MarkusLude


...you know, I didn't think to check those. I'll try the code you suggest. Thank you very much. --Suitov

None of these rewrite rules worked for me until I lost the leading slash on the pattern to be matched. Eg

^twine$
not
^/twine$
. Then they did, for which, thank you muchly. --Wayne

UseModWiki | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited July 23, 2008 12:11 am by 85-211-248-77.dsl.pipex.com (diff)
Search: