Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: SNews 1.6 with Lighty  (Read 4676 times)

od1n

  • Newbie
  • *
  • Karma: 1
  • Posts: 2
SNews 1.6 with Lighty
« on: February 10, 2008, 02:41:02 PM »

Hi,

im totally new to sNews and have a problem on adepting the rewrite rules in the htaccess
file from apache to lighttpd . Im afraid apache is not an alternative for me
Can you help me?

<IfModule mod_php4.c>
    php_value session.use_trans_sid 0
</IfModule>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
RewriteEngine On
#RewriteBase /sNews16
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+) index.php?category=$1&title=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+)/([^/]+)/
index.php?category=$1&title=$2&commentspage=$3 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9_-]+)/([0-9]+)/
index.php?category=$1&nbsp;articlespage=$2 [L]

I added the following rule to my lighttpd.conf:


url.rewrite-once = ( "^(.*)" => "$1"
                     "^(.*)$" => "index.php?category=$1",
                     "^([a-z_]+)/([^/]+)" =>
"index.php?category=$1&title=$2",
                     "^([a-z_]+)/([^/]+)/([^/]+)/" =>
"index.php?category=$1&title=$2&commentspage=$3",
                     "^([a-z0-9_-]+)/([0-9]+)/" =>
"index.php?category=$1&nbsp;articlespage=$2"
)

I also tried rules i found in the forum, they didnt work also.
What have i done wrong?
Thanks in advance for your help.
Logged

invarbrass

  • Full Member
  • ***
  • Karma: 18
  • Posts: 117
    • http://snews.extremebittorrent.com
Re: SNews 1.6 with Lighty
« Reply #1 on: February 10, 2008, 02:53:03 PM »

It's good to know some people are trying to run snews on httpds other than the ubiquitous apache. I've been closely monitoring the development of lightHttpd for a while (I was developing a webserver for windows myself  ;) ).

It's really gonna be awesome if we can run snews on lighty+FCGI with an op-code cacher like APC, eAccelerator or X-Cache! I am personally interested to run snews under nginx. Has anybody ported the URL-rewriting rule for other webservers?
Logged

invarbrass

  • Full Member
  • ***
  • Karma: 18
  • Posts: 117
    • http://snews.extremebittorrent.com
Re: SNews 1.6 with Lighty
« Reply #2 on: February 10, 2008, 02:59:23 PM »

od1n: welcome to snews!
I can't help you with regex patterns, but you might want to look at this mod here: http://snewscms.com/forum/index.php?topic=6560.0 This mod allows you to use sNews without URL rewriting.
Live demo: http://demo.snewscms.cn/snews/
Hope this helps.
Logged

od1n

  • Newbie
  • *
  • Karma: 1
  • Posts: 2
Re: SNews 1.6 with Lighty
« Reply #3 on: February 11, 2008, 10:29:39 PM »

Great, it seems to work, Thanks :D
Does it affect the security of the webapp in some way?
Logged

jzerbe

  • Guest
Re: SNews 1.6 with Lighty
« Reply #4 on: June 27, 2008, 05:10:36 AM »

I managed to get a working url.rewrite for snews in lighttpd.

url.rewrite-once = (
"^(.*)\.(.*)" => "$0",
"^(.*)/" => "index.php?category=$1",
"^([a-z_]+)/([^/]+)/" => "index.php?category=$1&title=$2",
"^([a-z_]+)/([^/]+)/([^/]+)/" => "index.php?category=$1&title=$2&commentspage=$3",
"^([a-z0-9_-]+)/([0-9]+)/" => "index.php?category=$1&articlespage=$2"
)

Hope this works for the rest of you guys.
Logged

mirkus

  • Newbie
  • *
  • Karma: 0
  • Posts: 3
Re: SNews 1.6 with Lighty
« Reply #5 on: July 03, 2009, 03:34:06 AM »

I managed to get a working url.rewrite for snews in lighttpd.

url.rewrite-once = (
"^(.*)\.(.*)" => "$0",
"^(.*)/" => "index.php?category=$1",
"^([a-z_]+)/([^/]+)/" => "index.php?category=$1&title=$2",
"^([a-z_]+)/([^/]+)/([^/]+)/" => "index.php?category=$1&title=$2&commentspage=$3",
"^([a-z0-9_-]+)/([0-9]+)/" => "index.php?category=$1&articlespage=$2"
)

Hope this works for the rest of you guys.

Snews 1.7 unfortunately does not work, your way  :(
issues that the content is not found, all the time
Logged