Page 1 of 1

Lighttpd rewrite instructions are wrong!

Posted: Tue Dec 23, 2008 9:03 pm
by pozmu
Hi

I installed CMSMS on lighttpd for the first time. I found rewrite instructions here: http://wiki.cmsmadesimple.org/index.php ... retty_URLs
I tried to use the more advanced version:

Code: Select all

  url.rewrite-final = (
   "^/(admin.*)$" => "/$1",
   "^/(uploads.*)$" => "/$1",
   "^/([^.?]*)(\.htm)$" => "/index.php?page=$1",
    "^/([^.?]*)$" => "/index.php?page=$1"
  )
It seemed to work, but when I tried to upload image I would see "error 404"/ "bad content encoding" (different messages in different browser). I couldn't figure what's wrong, logs were clear, then I spotted that image upload form file is ending with *.htm, so I deleted the rewrite rules and it worked... The first, simpler method seems to be working ok too....
I'm not sure what's wrong here, the rewrite rule or server behavior, but I think it should be somehow corrected...

Re: Lighttpd rewrite instructions are wrong!

Posted: Sat Dec 27, 2008 8:24 pm
by Pierre M.
Hello,

the "pretty URLs" topic is spread in the doc for now...

I like the simple version I see tonight on the wiki :

Code: Select all

url.rewrite-final = (
    "^/(admin)/(.*)$" => "/$1/$2",
    "^/([^.?]*)$" => "/index.php?page=$1"
  )
If it works for you, what about deriving it to

Code: Select all

url.rewrite-final = (
    "^/(admin)/(.*)$" => "/$1/$2",
    "^/(uploads)/(.*)$" => "/$1/$2",
    "^/([^.?]*)$" => "/index.php?page=$1"
  )
and then try to make a .html suffix work ?

Feel free to contribute to the wiki with your forum account.

Pierre M.