<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.gmailquote
        {mso-style-name:gmail_quote;}
span.q
        {mso-style-name:q;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Tahoma","sans-serif";
        color:#215868;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'>Eric,<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'>I have pmwiki installed with Apache running on a Windows XP
machine.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'>My web root directory is C:\web<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'>The full path of the pmwiki install is C:\web\wiki\pmwiki.php<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'>The URL that I would like to be home is <a
href="http://hip.eharch.com">http://hip.eharch.com</a> and this works.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'>Actually, my homepage is located at <a
href="http://hip.eharch.com/Main/Main">http://hip.eharch.com/Main/Main</a>
which also works if directly typed into the browser URL bar.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'>My .htaccess file is located inside C:\web and its contents are
as follows:<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'><o:p> </o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif";color:#215868'># Use mod_rewrite to enable
"Clean URLs" for a PmWiki installation.<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif";color:#215868'>RewriteEngine On<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif";color:#215868'># Define the rewrite
base. It's not necessarily PmWiki's directory.<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif";color:#215868'>RewriteBase /<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif";color:#215868'># Send requests without
parameters to pmwiki.php.<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif";color:#215868'>RewriteRule
^$
/wiki/pmwiki.php [L]<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif";color:#215868'># Send requests for index.php
to pmwiki.php.<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif";color:#215868'>RewriteRule ^index\.php$
/wiki/pmwiki.php [L]<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif";color:#215868'># Send requests to pmwiki.php,
appending the query string part.<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif";color:#215868'>RewriteRule
^([A-Z0-9\xa0-\xff].*)$ /wiki/pmwiki.php?n=$1 [QSA,L]<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'>Interestingly, all the URLs when clicking Pmwiki internal links
have the “?n=” in them. However, if one types an address without
that, the wiki is able to resolve it. <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'>For example, if you click “Projects” on the sidebar,
it goes to <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'><a href="http://hip.eharch.com/?n=Projects/Projects">http://hip.eharch.com/?n=Projects/Projects</a><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'>but if you manually type <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'><a href="http://hip.eharch.com/Projects/Projects">http://hip.eharch.com/Projects/Projects</a>
<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'>it still works.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'>Thanks for your attention.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'>Sameer<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:#215868'><o:p> </o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> Eric Celeste [mailto:efc.dev@gmail.com] <br>
<b>Sent:</b> Tuesday, December 04, 2007 2:16 PM<br>
<b>To:</b> Sameer Kumar<br>
<b>Cc:</b> pmwiki-users@pmichaud.com<br>
<b>Subject:</b> Re: [pmwiki-users] Clean URLs (Another question from the
newbie)<o:p></o:p></span></p>
</div>
<p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p>
<p class=MsoNormal style='margin-left:.5in'>The only other problem I see is
potentially the leading "/" on the rewritten address. In other words,
all the "/singles" below should probably be "singles"
instead (assuming "singles" is not actually at the root of your hard
disk). <o:p></o:p></p>
<div>
<p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'>Really, to debug this would require
more detailed information using only full paths.<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'>What is the full path of your
pmwiki install? <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'>(for example
"/home/efc/www/pmwiki/pmwiki.php")<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'>What is the URL you would like to
be "home" for your wiki?<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'>(for example " <a
href="http://mydomain.org/Main/HomePage">http://mydomain.org/Main/HomePage</a>")<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'>What is the full path of your
".htaccess" file?<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'>(for example
"/home/efc/www/.htaccess") <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'>Assumption: your server is
configured so that a request of a page from your domain actually reaches your
.htaccess file.<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'>...Eric<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p>
<div>
<p class=MsoNormal style='margin-left:.5in'><span class=gmailquote>On 12/4/07, <b>Sameer
Kumar</b> <<a href="mailto:skumar@eharch.com">skumar@eharch.com</a>>
wrote:</span><o:p></o:p></p>
<div>
<div>
<p style='margin-left:.5in'><span style='font-size:10.0pt;color:#215868'> </span><o:p></o:p></p>
<div>
<div>
<p style='margin-left:1.0in'><span style='color:#215868'><Snip></span><br>
<span class=q>Following the directions in the clean URL cookbook I set up my
.htaccess</span><br>
<span class=q>file in /website as follows:</span><br>
<br>
<span class=q># Use mod_rewrite to enable "Clean URLs" for a PmWiki
installation.</span><br>
<span class=q>RewriteEngine On </span><br>
<span class=q># The rewrite base will be the document root.</span><br>
<span class=q>RewriteBase /website</span><br>
<span class=q># Send requests without parameters to pmwiki.php.</span><br>
<span class=q>RewriteRule
^$
/singles/pmwiki.php [L]</span><br>
<span class=q># Send requests for index.php to pmwiki.php .</span><br>
<span class=q>RewriteRule ^index\.php$ /singles/pmwiki.php [L]</span><br>
<span class=q># Don't rewrite requests for any files, directories, or symbolic</span><br>
<span class=q># links (shortcuts) that exist on the filesystem.</span><br>
<span class=q># RewriteCond %{REQUEST_FILENAME} !-f</span><br>
<span class=q># RewriteCond %{REQUEST_FILENAME} !-d</span><br>
<span class=q># RewriteCond %{REQUEST_FILENAME} !-l # Send requests to
pmwiki.php,</span><br>
<span class=q>appending the query string part.</span><br>
<span class=q>RewriteRule ^([A-Z0-9\xa0-\xff].*)$
/singles/pmwiki.php?n=$1 [QSA,L]</span><br>
<br>
<span class=q>I set up my /website/singles/local/config.php file as follows:</span><br>
<br>
<span class=q><?php if (!defined('PmWiki')) exit();</span><br>
<span class=q>## Use "Clean URLs".</span><br>
<span class=q>$EnablePathInfo = 1;</span><br>
<span class=q>$ScriptUrl = "<a href="http://localhost" target="_blank">
http://localhost</a>";</span><br>
<span class=q>## more configuration settings...</span><br>
<br>
<span style='color:#215868'><snip></span><o:p></o:p></p>
<p style='margin-left:1.5in'>I believe you want the RewriteBase to be the root
as served rather than the root as stored. Try "RewriteBase /"
instead.<o:p></o:p></p>
<p style='margin-left:1.5in'>Note, the should also allow "<a
href="http://localhost" target="_blank"> http://localhost</a>" without the
"index.php" to bring up your site.<o:p></o:p></p>
<p style='margin-left:1.5in'>Also, for this to work your Apache server on the
localhost must have mod_rewrite activated. You might want to check to be sure
this is the case. <o:p></o:p></p>
<p style='mso-margin-top-alt:5.0pt;margin-right:0in;margin-bottom:12.0pt;
margin-left:1.5in'>...Eric<o:p></o:p></p>
<p style='mso-margin-top-alt:5.0pt;margin-right:0in;margin-bottom:12.0pt;
margin-left:1.0in'><snip><o:p></o:p></p>
<p style='mso-margin-top-alt:5.0pt;margin-right:0in;margin-bottom:12.0pt;
margin-left:.5in'>Eric,<o:p></o:p></p>
<p style='margin-left:.5in'>I have exactly the same situation as Tom's
description above and I have the .htaccess file in my root directory. I have
followed all the instructions that I have found (my htaccess file looks exactly
the same as above) and can also confirm that mod_rewrite is also activated for
my Apache install.<o:p></o:p></p>
<p style='margin-left:.5in'>However, I cannot get rid of a "?n=" from
my URLs. For example, my URLs read as:<o:p></o:p></p>
<p style='margin-left:.5in'><a
href="http://hip.eharch.com/?n=Materials/Materials" target="_blank">http://hip.eharch.com/?n=Materials/Materials</a><o:p></o:p></p>
<p style='margin-left:.5in'>instead of <o:p></o:p></p>
<p style='margin-left:.5in'><a href="http://hip.eharch.com/Materials/Materials"
target="_blank">http://hip.eharch.com/Materials/Materials</a><o:p></o:p></p>
<p style='margin-left:.5in'>which I would prefer.<o:p></o:p></p>
<p style='margin-left:.5in'>Would you have any ideas or suggestions regarding
getting rid of the "?n=" ?<o:p></o:p></p>
<p style='margin-left:.5in'>Thanks. Sameer<o:p></o:p></p>
<p style='margin-left:1.0in'> <o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class=MsoNormal style='margin-left:.5in'><br>
<o:p></o:p></p>
</div>
</div>
</body>
</html>