I followed the instructions in the INSTALL file, and got Wikipedia up and running.
However, the URL rewriting, cut and pasted from the INSTALL file, doesn't seem to work at all. This seems to work:
http://reactor-core.org/t/wiki.phtml?title=Main_Page
But this does NOT:
http://reactor-core.org/t/wiki/Main_Page
Any ideas what I am doing wrong?
Here is the relevant section of my httpd.conf:
=== SNIP === <Directory /usr/home/djw/src/wikipedia/phpwiki/newcodebase> php_admin_flag engine on </Directory> <VirtualHost ...> ... Alias /t /usr/home/djw/src/wikipedia/phpwiki/newcodebase/ RewriteEngine On RewriteRule ^/t/wiki/wiki.phtml(.*) /t/wiki.phtml$1 RewriteRule ^/t/wiki/(.*)$ /t/wiki.phtml?title=$1 RewriteRule ^/movie/(.*) http://us.imdb.com/Title?$1 [R] RewriteRule ^/isbn/(.*) http://www.amazon.com/exec/obidos/ASIN/$1 [R] ... </VirtualHost> === SNIP ===
Also, I would like to make the direct wiki.phtml URL unaccessable; I want to force people to use the /t/wiki/* style URL, and not give out any access at all to the /t/wiki.phtml?* URL's. Ideas?
Jonathan
On Tue, 2002-12-17 at 08:50, Jonathan Walther wrote:
However, the URL rewriting, cut and pasted from the INSTALL file, doesn't seem to work at all. This seems to work:
...
Any ideas what I am doing wrong?
Hmm, do 'Alias' and mod_rewrite interact well?
Alias /t /usr/home/djw/src/wikipedia/phpwiki/newcodebase/ RewriteEngine On RewriteRule ^/t/wiki/wiki.phtml(.*) /t/wiki.phtml$1 RewriteRule ^/t/wiki/(.*)$ /t/wiki.phtml?title=$1 RewriteRule ^/movie/(.*) http://us.imdb.com/Title?$1 [R] RewriteRule ^/isbn/(.*) http://www.amazon.com/exec/obidos/ASIN/$1 [R]
For reference, here's the entry for test.wikipedia.org:
<VirtualHost 130.94.122.197> DocumentRoot "/usr/local/apache/htdocs-test" ServerName test.wikipedia.org ErrorLog logs/test.wikipedia.org-error_log CustomLog logs/test.wikipedia.org-log combined
RewriteEngine On RewriteMap ampescape int:ampescape RewriteRule ^/wiki/(.*)$ /w/wiki.phtml?title=${ampescape:$1} [L] RewriteRule ^/w/wiki.phtml(.*) /w/wiki.phtml$1 RewriteRule ^/wiki$ /w/wiki.phtml RewriteRule ^/$ /w/wiki.phtml </VirtualHost>
('ampescape' is a custom conversion function to turn an ampersand & to %26 so that titles with ampersands don't get screwed over, since the built-in 'urlescape' doesn't fix them. Patch for Apache 1.3.26+: http://www.wikipedia.org/tools/ampersand.diff )
Also, I would like to make the direct wiki.phtml URL unaccessable; I want to force people to use the /t/wiki/* style URL, and not give out any access at all to the /t/wiki.phtml?* URL's. Ideas?
Stick a [QSA] on the rewrite rule to append instead of replace the query string, see if that goes in the right direction.
-- brion vibber (brion @ pobox.com)
wikitech-l@lists.wikimedia.org