Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: Redirecting settings for cherokee webserver  (Read 5965 times)

Manuel Pancorbo

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 72
Redirecting settings for cherokee webserver
« on: November 27, 2006, 01:47:44 PM »

[I'm not sure about the right forum. Please, feel free to move it]

Cherokee is a light and flexible webserver easier to config than Apache. I use it in my PC for my own small projects; because I've started using SNews, I must wander around its settings in order to emulate the .htaccess redirections. So, that is my solution for other eventual cherokee/snews-fans.

Go to your server conf. file in /etc/cherokee/sites-available and put this code somewhere in it. First, it must be commented out the directive "Handler common" that affects the whole site. It is assumed that the site hangs on the root directory defined in this conf. file

Code: [Select]
# Comment out the following
#Directory / {
#Handler common
#
#}

# Protect some fixed directories
Directory /css {
Handler common
}

Directory /js {
Handler common
}

Directory /images {
Handler common
}
# and so on...

# now, redirection starts
Directory / {
Handler redir {
Rewrite "/(.*)$" "/index.php?category=$1"
Rewrite "/([a-z_]+)/([^/]+)" "/index.php?category=$1&title=$2"
Rewrite "/([a-z_]+)/([^/]+)/([^/]+)/" "/index.php?category=$1&title=$2&commentspage=$3"
Rewrite "/([a-z0-9_-]+)/([0-9]+)/" "/index.php?category=$1 articlespage=$2"
}
}
Logged

brauck

  • Hero Member
  • *****
  • Karma: 18
  • Posts: 556
    • http://www.hbw-webdesign.nl/
Redirecting settings for cherokee webserver
« Reply #1 on: November 27, 2006, 05:51:42 PM »

Looks nice. But the drawback is that you can't simulate live hosting, so I stick to Linux/Apache for my local webserver.  :)
Logged
Confidence is reduced complexity.
brauck.nl for free css templates

Manuel Pancorbo

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 72
Redirecting settings for cherokee webserver
« Reply #2 on: November 27, 2006, 10:56:23 PM »

Quote from: brauck
Looks nice. But the drawback is that you can't simulate live hosting, so I stick to Linux/Apache for my local webserver.  :)
Well, Cherokee is somewhere used (really Apache rules...) On the other hand, my personal projects *live* even hosted in my modest box:

http://sks.merseine.nu. Powered by Cherokee ;-)
Logged