Date: 21 January 2008

  • I hate the default pmwiki messy url (addresses) like
    • http://www.mathcasts.org/mtwiki/pmwiki.php?n=Main.Homepage and want standard addresses like
    • http://www.mathcasts.org/mtwiki/Main/Homepage.

In geekese, this is called "clean urls". Official PmWiki Help Page

  • I had managed to get clean urls on this (my dreamhost site) without too much trouble, but
    • I could not get clean urls to work on my startlogic sites; with these steps I did.

*First steps

1. I put my wiki one step into the root html folder (not necessary, see update below*).

1.a. The root html folder of my websites on startlogic is public_html.
1.b. I put my wiki folder in this folder (and called it "wiki" not "pmwiki").

2. In my backup of my wiki (on my harddisk) in the /local folder, I opened the file config.php  and

2.a I removed the comment markers "##" in front of the line:  $EnablePathInfo = 1; .

If you are in dreamweaver, the line will turn from orange (comment) to black (a real line).

2.b. I hit enter and added the line: $ScriptUrl = 'http://www.emathforall.com/wiki'; .

There is a line above this with $ScriptUrl = 'http://www.emathforall.com/wiki/pmwiki.php';.
I just left it there; but probably I should "comment" it by adding "##" in front of that line.

2.c. Saved this file(config.php) and FTP uploaded it to the /local folder in my /wiki.

*Second steps
3. I opened Notepad (you can use any text editor)

3.a. Copied and pasted in the following the red text below. Change ReWriteBase!!
# Use mod_rewrite to enable "Clean URLs" for a PmWiki installation.
RewriteEngine On
# Define the rewrite base.
RewriteBase /wiki
# Send requests without parameters to pmwiki.php.
RewriteRule ^$           pmwiki.php  [L]
# Send requests for index.php to pmwiki.php.
RewriteRule ^index\.php$ pmwiki.php  [L]
# Send requests to pmwiki.php, appending the query string part.
RewriteRule ^([A-Z0-9\xa0-\xff].*)$ pmwiki.php?n=$1  [QSA,L]
3.b. Saved the file as ".htaccess" (with the period in the front)
3.c. FTP copied it into /wiki, i.e. the root folder of my wiki (where pmwiki.php is).

BTW: I always write internal links using a forward slash and never a dot -

[[glossary/triangle|mylinktext]] and not [[glossary.triangle|mylinktext]] .

Date: 25 January 2008 Not necessary to put wiki in root; it works even in deeper folder.


 

 Up one level


Page last modified on April 29, 2008, at 10:22 AM