I've been playing around with the sNews CMS and it's among the better lightweight content management systems I've tried so far, at least in terms of speed and size. However, as someone who does not know how to write .htaccess files, I'm wondering how I can achieve pretty URLs on my own pages (ie, events.php) without impacting the CMS's functionality.
The开发者_开发百科 .htaccess is:
<IfModule mod_php4.c>
php_value session.use_trans_sid 0
</IfModule>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
RewriteEngine On
#RewriteBase /sNews17
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]
I'm a long time and current user of sNews.
It's working this way in the .htaccess:
When anything's in the url other than the base, it's re-written to index.php?category=$1
.
Inside sNews, near the top there's the line that says:
if(!empty($_GET['category'])){
That's where the two are tied together.
To make SEF links, use this:
$titlesef=strtolower(str_replace(' ','-',$_POST['title']));
(That's how I do it, but I learned that from sNews.)
Additionally - view source on your index, and look at the "base" line in the title block.
Work with the base line, rewrite base etc.. to make pages fit into sNews.
You may not have to though - if there's a physical page at an address (events.php), that will show instead of generated content.
I do agree that it is one of the best lightweight CSMs out there. Could you tell me what version of sNews you are using? I've been playing around with it too, and I have clean URLs by default (I use v1.7).
精彩评论