[pmwiki-users] .htaccess file

Petko Yotov 5ko at 5ko.fr
Mon Dec 28 21:13:39 CST 2009

On Tuesday 29 December 2009 03:16:52 Wade Hudson wrote:
>  Petko Yotov wrote: 
> >   http://article.gmane.org/gmane.comp.web.wiki.pmwiki.user/54771
> >
> > Note that all my PmWiki files are in the root directory of the server, not
> > in a subdirectory like public_html/ and both urls show me the same stuff:
> >  http://www.example.net/pmwiki.php
> >  http://www.example.net/
>  Petko, that looks good, though others have recommended against using the
>  root directory.

My post describes how I use it, from the root directory. To use it from a sub-
directory, you can have in your _root_ .htaccess :

  RewriteEngine On
  RewriteBase /

  # requests for example.net / , send directly to PmWiki and exit
  RewriteRule ^$  /pm/pmwiki.php  [QSA,L] 

  # requests for example.net/Something
  RewriteCond %{REQUEST_FILENAME} !-f        # if not a file,
  RewriteCond %{REQUEST_FILENAME} !-d        # and not a dir,
  RewriteCond %{REQUEST_FILENAME} !-l        # and not a link,

  # and looks like a PmWiki request, send to PmWiki
  RewriteRule ^([A-Z0-9\x80-\xFF].*)$  /pm/pmwiki.php?n=$1  [QSA,L]

(assuming your subdirectory is named "pm" - in your case, "public_html")

Note, on some installations, "public_html" is the name of the default public 
root directory of the server. I recommend renaming that subdirectory to 
another name to avoid confusions.

Don't forget to set in local/config.php the $ScriptUrl variable (see the 
message I gave you earlier).

>  But I'm not sure about the best way to move my files to
>  the root directory. Can you advise me on that?

How do you manage (add/delete/rename/move) files on your server?

If you have some sort of FTP file manager like Windows Explorer or FileZilla, 
you go to your subdirectory, select all files, cut with Ctrl+X, go back/up to 
the parent directory, paste with Ctrl+V.

If you log in via SSH, you go to the subdirectory and type 
  mv ./* ../     [press Enter]


More information about the pmwiki-users mailing list