I've only used Apache in a Unix environment, so I have no idea what issues might be stirred up by this being a Windows environment.<div><br class="webkit-block-placeholder"></div><div>> Interestingly, all the URLs when clicking Pmwiki internal links have the "?n=" in them.
</div><div>> However, if one types an address without that, the wiki is able to resolve it.</div><div><br class="webkit-block-placeholder"></div><div>The "?n=" being there or not in the links should be controlled by the $EnablePathInfo variable in the
config.php file. Interestingly, the comments about this in the config file state: "try setting $EnablePathInfo below. Note that this doesn't work in all environments, it depends on your webserver and PHP configuration." Maybe there is something else in the machine or PHP environment that is preventing EnablePathInfo from doing it's job.
</div><div><br class="webkit-block-placeholder"></div><div>As to why the link to <a href="http://hip.eharch.com/Main/Main">http://hip.eharch.com/Main/Main</a> does not work, I am a bit more mystified. For one thing, I don't know what you mean by it works if typed into directly. Typing a URL or clicking on it should make no difference to how it is resolved, if it does make a difference, then I'm out of my depth. When I try to go to that URL I get...
</div><div><br class="webkit-block-placeholder"></div><div> The requested URL /wiki/pmwiki.phpMain/Main was not found on this server.</div><div><br class="webkit-block-placeholder"></div><div>Notice the missing "/" between "php" and the first "Main". The only thing I can think of is that your EnablePathInfo is actually not set to "1". Check to make sure the "#" is removed at the front of that line in your
config.php file.</div><div><br class="webkit-block-placeholder"></div><div>Good luck,</div><div>...Eric</div><div><br><div><span class="gmail_quote">On 12/4/07, <b class="gmail_sendername">Sameer Kumar</b> <<a href="mailto:skumar@eharch.com">
skumar@eharch.com</a>> wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p><span style="font-size:10.0pt;color:#215868">Eric,</span></p>
<p><span style="font-size:10.0pt;color:#215868">I have pmwiki installed with Apache running on a Windows XP
machine.</span></p>
<p><span style="font-size:10.0pt;color:#215868">My web root directory is C:\web</span></p>
<p><span style="font-size:10.0pt;color:#215868">The full path of the pmwiki install is C:\web\wiki\pmwiki.php</span></p>
<p><span style="font-size:10.0pt;color:#215868">The URL that I would like to be home is <a href="http://hip.eharch.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://hip.eharch.com</a> and this works.
</span></p>
<p><span style="font-size:10.0pt;color:#215868">Actually, my homepage is located at <a href="http://hip.eharch.com/Main/Main" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://hip.eharch.com/Main/Main
</a>
which also works if directly typed into the browser URL bar.</span></p>
<p><span style="font-size:10.0pt;color:#215868"> </span></p>
<p><span style="font-size:10.0pt;color:#215868">My .htaccess file is located inside C:\web and its contents are
as follows:</span></p><span class="q">
<p><span style="font-size:10.0pt;color:#215868"> </span></p>
<p style="margin-left:.5in"><span style="font-size:10.0pt;color:#215868"># Use mod_rewrite to enable
"Clean URLs" for a PmWiki installation.</span></p>
<p style="margin-left:.5in"><span style="font-size:10.0pt;color:#215868">RewriteEngine On</span></p></span>
<p style="margin-left:.5in"><span style="font-size:10.0pt;color:#215868"># Define the rewrite
base. It's not necessarily PmWiki's directory.</span></p>
<p style="margin-left:.5in"><span style="font-size:10.0pt;color:#215868">RewriteBase /</span></p><span class="q">
<p style="margin-left:.5in"><span style="font-size:10.0pt;color:#215868"># Send requests without
parameters to pmwiki.php.</span></p></span>
<p style="margin-left:.5in"><span style="font-size:10.0pt;color:#215868">RewriteRule
^$
/wiki/pmwiki.php [L]</span></p><span class="q">
<p style="margin-left:.5in"><span style="font-size:10.0pt;color:#215868"># Send requests for index.php
to pmwiki.php.</span></p></span>
<p style="margin-left:.5in"><span style="font-size:10.0pt;color:#215868">RewriteRule ^index\.php$
/wiki/pmwiki.php [L]</span></p><span class="q">
<p style="margin-left:.5in"><span style="font-size:10.0pt;color:#215868"># Send requests to pmwiki.php,
appending the query string part.</span></p></span>
<p style="margin-left:.5in"><span style="font-size:10.0pt;color:#215868">RewriteRule
^([A-Z0-9\xa0-\xff].*)$ /wiki/pmwiki.php?n=$1 [QSA,L]</span></p>
<p><span style="font-size:10.0pt;color:#215868"> </span></p>
<p><span style="font-size:10.0pt;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. </span></p>
<p><span style="font-size:10.0pt;color:#215868">For example, if you click "Projects" on the sidebar,
it goes to </span></p>
<p><span style="font-size:10.0pt;color:#215868"><a href="http://hip.eharch.com/?n=Projects/Projects" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://hip.eharch.com/?n=Projects/Projects</a></span>
</p>
<p><span style="font-size:10.0pt;color:#215868">but if you manually type </span></p>
<p><span style="font-size:10.0pt;color:#215868"><a href="http://hip.eharch.com/Projects/Projects" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://hip.eharch.com/Projects/Projects</a>
</span></p>
<p><span style="font-size:10.0pt;color:#215868">it still works.</span></p>
<p><span style="font-size:10.0pt;color:#215868"> </span></p>
<p><span style="font-size:10.0pt;color:#215868">Thanks for your attention.</span></p>
<p><span style="font-size:10.0pt;color:#215868">Sameer</span></p>
<p><span style="font-size:10.0pt;color:#215868"> </span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p style="margin-left:.5in"><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt"> Eric Celeste [mailto:<a href="mailto:efc.dev@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
efc.dev@gmail.com</a>] <br>
<b>Sent:</b> Tuesday, December 04, 2007 2:16 PM<br>
<b>To:</b> Sameer Kumar<br>
<b>Cc:</b> <a href="mailto:pmwiki-users@pmichaud.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">pmwiki-users@pmichaud.com</a><br>
<b>Subject:</b> Re: [pmwiki-users] Clean URLs (Another question from the
newbie)</span></p>
</div><div><span class="e" id="q_116a6b2d8ded421a_9">
<p style="margin-left:.5in"> </p>
<p 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). </p>
<div>
<p style="margin-left:.5in"> </p>
</div>
<div>
<p style="margin-left:.5in">Really, to debug this would require
more detailed information using only full paths.</p>
</div>
<div>
<p style="margin-left:.5in"> </p>
</div>
<div>
<p style="margin-left:.5in">What is the full path of your
pmwiki install? </p>
</div>
<div>
<p style="margin-left:.5in">(for example
"/home/efc/www/pmwiki/pmwiki.php")</p>
</div>
<div>
<p style="margin-left:.5in"> </p>
</div>
<div>
<p style="margin-left:.5in">What is the URL you would like to
be "home" for your wiki?</p>
</div>
<div>
<p style="margin-left:.5in">(for example " <a href="http://mydomain.org/Main/HomePage" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mydomain.org/Main/HomePage</a>")</p>
</div>
<div>
<p style="margin-left:.5in"> </p>
</div>
<div>
<p style="margin-left:.5in">What is the full path of your
".htaccess" file?</p>
</div>
<div>
<p style="margin-left:.5in">(for example
"/home/efc/www/.htaccess") </p>
</div>
<div>
<p style="margin-left:.5in"> </p>
</div>
<div>
<p style="margin-left:.5in">Assumption: your server is
configured so that a request of a page from your domain actually reaches your
.htaccess file.</p>
</div>
<div>
<p style="margin-left:.5in"> </p>
</div>
<div>
<p style="margin-left:.5in">...Eric</p>
</div>
<div>
<p style="margin-left:.5in"> </p>
<div>
<p style="margin-left:.5in"><span>On 12/4/07, <b>Sameer
Kumar</b> <<a href="mailto:skumar@eharch.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">skumar@eharch.com</a>>
wrote:</span></p>
<div>
<div>
<p style="margin-left:.5in"><span style="font-size:10.0pt;color:#215868"> </span></p>
<div>
<div>
<p style="margin-left:1.0in"><span style="color:#215868"><Snip></span><br>
<span>Following the directions in the clean URL cookbook I set up my
.htaccess</span><br>
<span>file in /website as follows:</span><br>
<br>
<span># Use mod_rewrite to enable "Clean URLs" for a PmWiki
installation.</span><br>
<span>RewriteEngine On </span><br>
<span># The rewrite base will be the document root.</span><br>
<span>RewriteBase /website</span><br>
<span># Send requests without parameters to pmwiki.php.</span><br>
<span>RewriteRule
^$
/singles/pmwiki.php [L]</span><br>
<span># Send requests for index.php to pmwiki.php .</span><br>
<span>RewriteRule ^index\.php$ /singles/pmwiki.php [L]</span><br>
<span># Don't rewrite requests for any files, directories, or symbolic</span><br>
<span># links (shortcuts) that exist on the filesystem.</span><br>
<span># RewriteCond %{REQUEST_FILENAME} !-f</span><br>
<span># RewriteCond %{REQUEST_FILENAME} !-d</span><br>
<span># RewriteCond %{REQUEST_FILENAME} !-l # Send requests to
pmwiki.php,</span><br>
<span>appending the query string part.</span><br>
<span>RewriteRule ^([A-Z0-9\xa0-\xff].*)$
/singles/pmwiki.php?n=$1 [QSA,L]</span><br>
<br>
<span>I set up my /website/singles/local/config.php file as follows:</span><br>
<br>
<span><?php if (!defined('PmWiki')) exit();</span><br>
<span>## Use "Clean URLs".</span><br>
<span>$EnablePathInfo = 1;</span><br>
<span>$ScriptUrl = "<a href="http://localhost" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://localhost</a>";</span><br>
<span>## more configuration settings...</span><br>
<br>
<span style="color:#215868"><snip></span></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.</p>
<p style="margin-left:1.5in">Note, the should also allow "<a href="http://localhost" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://localhost</a>" without the
"index.php" to bring up your site.</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. </p>
<p style="margin-right:0in;margin-bottom:12.0pt;margin-left:1.5in">...Eric</p>
<p style="margin-right:0in;margin-bottom:12.0pt;margin-left:1.0in"><snip></p>
<p style="margin-right:0in;margin-bottom:12.0pt;margin-left:.5in">Eric,</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.</p>
<p style="margin-left:.5in">However, I cannot get rid of a "?n=" from
my URLs. For example, my URLs read as:</p>
<p style="margin-left:.5in"><a href="http://hip.eharch.com/?n=Materials/Materials" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://hip.eharch.com/?n=Materials/Materials</a></p>
<p style="margin-left:.5in">instead of </p>
<p style="margin-left:.5in"><a href="http://hip.eharch.com/Materials/Materials" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://hip.eharch.com/Materials/Materials</a></p>
<p style="margin-left:.5in">which I would prefer.</p>
<p style="margin-left:.5in">Would you have any ideas or suggestions regarding
getting rid of the "?n=" ?</p>
<p style="margin-left:.5in">Thanks. Sameer</p>
<p style="margin-left:1.0in"> </p>
</div>
</div>
</div>
</div>
</div>
<p style="margin-left:.5in"><br>
</p>
</div>
</span></div></div>
</div>
</blockquote></div><br> </div>