Lighttpd rewrite instructions are wrong!

Discussion of the documentation project.
Locked
User avatar
pozmu
Forum Members
Forum Members
Posts: 10
Joined: Wed Mar 19, 2008 12:45 pm

Lighttpd rewrite instructions are wrong!

Post 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...
Pierre M.

Re: Lighttpd rewrite instructions are wrong!

Post 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.
Locked

Return to “[locked] Documentation0ld”