Not logged in. · Lost password · Register
Forum: General Help and Support Server Setup RSS
Useslash setting not working properly.
Avatar
GTNman #1
Member since Nov 2006 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: Useslash setting not working properly.
I am running dokuwiki w/ PHP5 and lighttpd.  I have just implemented the rewrite as per the provided code.

I want to use the rewrite so that useslash is disabled.  However ever since the rewrite implementation I cannot get it working using the ':' only '/'

I am sure that it is something simple that I have missed.  Can anyone shed some light?
Avatar
andi (Administrator) #2
User title: splitbrain
Member since May 2006 · 3520 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hmm what lighty version do you run? Could you post the whole vhost block you use?
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
GTNman #3
Member since Nov 2006 · 7 posts
Group memberships: Members
Show profile · Link to this post
I am using lighty version:  lighttpd/1.4.11

vhosts config:

$HTTP["host"] == "localhost" { server.document-root = "/var/www"
url.rewrite = ( "^/$" => "index.php", "^([^.]+)$" => "index.php/$1" )
server.indexfiles = ( "index.php", "index.html" )
index-file.names = ( "index.php", "index.html", "index.htm", "default.htm" )
  fastcgi.server = (".php" =>
        ("localhost" =>
           ("socket" => "/tmp/phpadmin.socket",
                "bin-path" => "/usr/bin/php5-cgi -c /etc/php5/cgi/php.ini",
                "bin-environment" => (
                "PHP_FCGI_CHILDREN" => "8",
                "PHP_FCGI_MAX_REQUESTS" => "500"
                                        ) )))
}

(i believe that is my vhost block)
Avatar
andi (Administrator) #4
User title: splitbrain
Member since May 2006 · 3520 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hmm but the rewrite rules are very different from the ones shown at http://wiki.splitbrain.org/wiki:rewrite#lighttpd. Your config is not complete.

For your reference this is the config currently running at wiki.splitbrain.org

$HTTP["host"] =~ "(^wiki\.splitbrain\.org|(^|www\.)(dokuwiki\.org|dokuwiki\.info))$" {
    server.document-root  = "/www/wiki/htdocs"
    accesslog.filename    = "/www/_logs/wiki-access.log"

    # enable PHP
    static-file.exclude-extensions = ( ".php" )

    fastcgi.server = ( ".php" =>
                             (
                                ( "socket" => "/www/_fastcgi/wiki/wiki.socket",                                                                                              
                                  "check-local" => "disable",
                                  "broken-scriptfilename" => "enable"                                                                                
                                )
                             )
                         )

    # deny access completly to these
    $HTTP["url"] =~ "/\.ht" { url.access-deny = ( "" ) }
    $HTTP["url"] =~ "/_ht" { url.access-deny = ( "" ) }
    $HTTP["url"] =~ "^/bin/"  { url.access-deny = ( "" ) }
    $HTTP["url"] =~ "^/data/" { url.access-deny = ( "" ) }
    $HTTP["url"] =~ "^/inc/"  { url.access-deny = ( "" ) }
    $HTTP["url"] =~ "^/conf/"  { url.access-deny = ( "" ) }
    $HTTP["url"] =~ "^/current-old/"  { url.access-deny = ( "" ) }


    # canonical host
    $HTTP["host"] !~ "^wiki\.splitbrain\.org$" {
        url.redirect = (
                         "^/(.*)" => "http://wiki.splitbrain.org/$1",
                         ""       => "http://wiki.splitbrain.org/"
                       )
    }

    url.rewrite-once = (
                    "^(/|index.php)?$" => "/doku.php",
                    "^/lib/(.*)/?$" => "/lib/$1",
                    "^/_media/(.*)?\?(.*)$" => "/lib/exe/fetch.php?media=$1&$2",
                    "^/_media/(.*)$" => "/lib/exe/fetch.php?media=$1",
                    "^/_detail/(.*)?\?(.*)$" => "/lib/exe/detail.php?media=$1&$2",
                    "^/_detail/(.*)?$" => "/lib/exe/detail.php?media=$1",
                    "^/_export/([^/]+)/(.*)$" => "/doku.php?do=export_$1&id=$2",
                    "^/(?!doku.php|feed.php|langcheck.php|robots.txt|sitemap.xml.gz)(.*)\?(.*)/?$" => "/doku.php?id=$1&$2",

                    "^/(?!doku.php|feed.php|langcheck.php|robots.txt|sitemap.xml.gz)(.*)/?$" => "/doku.php?id=$1",
                  )

}
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
GTNman #5
Member since Nov 2006 · 7 posts
Group memberships: Members
Show profile · Link to this post
i think i posted the wrong rewrite?  does this one look better?

here is a copy of my lighttpd.conf -- > link

#### dokuwiki rewrite

url.rewrite-once = (
                    "^/wiki/(/|index.php)?$" => "/wiki/doku.php",
                    "^/wiki/lib/(.*)/?$" => "/wiki/lib/$1",
                    "^/wiki/_media/(.*)?\?(.*)$" => "/wiki/lib/exe/fetch.php?media=$1&$2",
                    "^/wiki/_media/(.*)$" => "/wiki/lib/exe/fetch.php?media=$1",
                    "^/wiki/_detail/(.*)?\?(.*)$" => "/wiki/lib/exe/detail.php?media=$1&$2",
                    "^/wiki/_detail/(.*)?$" => "/wiki/lib/exe/detail.php?media=$1",
                    "^/wiki/_export/([^/]+)/(.*)$" => "/wiki/doku.php?do=export_$1&id=$2",
                    "^/wiki/(?!doku.php|feed.php|robots.txt|sitemap.xml.gz)(.*)\?(.*)/?$" => "/wiki/doku.php?id=$1&$2",
                    "^/wiki/(?!doku.php|feed.php|robots.txt|sitemap.xml.gz)(.*)/?$" => "/wiki/doku.php?id=$1",
                  )


#### Added for dokuwiki security

# subdir of dokuwiki
var.basedir = "/wiki/"
# make sure those are always served through fastcgi and never as static files
static-file.exclude-extensions = ( ".php" )

# deny access completly to these
$HTTP["url"] =~ "/\.ht" { url.access-deny = ( "" ) }
$HTTP["url"] =~ "/_ht" { url.access-deny = ( "" ) }
$HTTP["url"] =~ "^" + basedir + "wiki/bin/"  { url.access-deny = ( "" ) }
$HTTP["url"] =~ "^" + basedir + "wiki/data/" { url.access-deny = ( "" ) }
$HTTP["url"] =~ "^" + basedir + "wiki/inc/"  { url.access-deny = ( "" ) }
$HTTP["url"] =~ "^" + basedir + "wiki/conf/" { url.access-deny = ( "" ) }
Avatar
andi (Administrator) #6
User title: splitbrain
Member since May 2006 · 3520 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The debian default config is overly complicated IMHO. Anyway try removing the last url.rewrite block:

url.rewrite = ( "^/$" => "index.php", "^([^.]+)$" => "index.php/$1" )
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
GTNman #7
Member since Nov 2006 · 7 posts
Group memberships: Members
Show profile · Link to this post
removed the line from my lighttpd.conf but still not working as it should. ??

I think it is working, however I think I may have made a mistake in terms of my understanding.

I had stored all of my wiki entries in the root of dokuwiki, outside of any namespaces.  Once I created a namespace, the useslash function was working properly.

Just took some time for me to hash it out.

Thanks andi!~
This post was edited on 2006-12-02, 00:00 by GTNman.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-02-17, 07:26:17 (UTC +01:00)