[pmwiki-users] Page Not Found vs 404

H. Fox haganfox at users.sourceforge.net
Fri Apr 21 11:32:38 CDT 2006


On 4/21/06, Philip Stitt <phil at octopusmusic.com> wrote:
> Hello. When I type (into the browser) a pagename or URL that doesn't yet
> exist, sometimes I get a 404 page, and sometimes I get PmWiki's
> "Site.PageNotFound" page. It seems to be random.

It probably depends on the case (upper vs. lower) of the first
character in the URL path.

> I'd like to always get
> the Site.PageNotFound. Is there a way to control this?

In your .htaccess file you can tell the server to send all requests to
PmWiki except for existing files, directories, and links.  Make a
backup of your .htaccess file and try changing the last rules to
something like these (except possibly with a path in front of
pmwiki.php):

# Don't rewrite requests for any files, directories, or symbolic
# links (shortcuts) that exist on the filesystem.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
# Send requests to pmwiki.php, appending the query string part.
RewriteRule (.*)         pmwiki.php?n=$1  [QSA,L]

Hagan

> Thanks,
> Phil




More information about the pmwiki-users mailing list