added by analyzerx on 21 Jan 2006.htaccessI've noticed some problems with URL rewrites so I've changed it a bit for anyone who has the same problems with me...
.htaccess did not check if the file I asked in the URL actually existed so I could not put anything else in the same folder as snews... (I could not access even my images folder for example...)
so this is my new .htaccess
#sNews v1.4
#php_flag zlib.output_compression On
#php_value zlib.output_compression_level 5
php_value session.use_trans_sid 0
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ index.php?category=$1 [L,QSA]
RewriteRule ^([a-z_]+)/([^/]+)/ index.php?category=$1&title=$2 [L,QSA]
RewriteRule ^([a-z_]+)/([^/]+)/([^/]+)/ index.php?category=$1&title=$2&commentspage=$3 [L,QSA]
I've added compression but you'll need to uncomment the 2nd and 3rd line...
From there before using rewrites apache will check if the directory/file actually exists...
for example if you have a 1.4 installation try accessing your image folder...
most likely you'll get a snews error...
after changing the .htaccess you will be able to access it... ^_^
Contact form bugfixalso this is a quick fix for the contact form in snews.php 1.4 testing2/3...
find:
// CONTACT
function contact() {
if ($_POST['contactform'] == "") {?>
echo l('contact'); ?>
}
if (isset($_POST['contactform'])) {
$to = s('website_email');
$subject = s('contact_subject');
$body = l('name') .": ". $_POST['name'] ."n";
$body .= l('email') .": ". $_POST['email'] ."n";
$body .= l('url') .": ". $_POST['weblink'] ."nn";
$body .= l('message') .": ". $_POST['message'] ."n";
if (strlen(clean($_POST['name'])) > 1 AND strlen(clean($_POST['message'])) > 1) {
mail($to, $subject, $body);
echo "". l('contact_sent') ."
";
echo "". l('backhome') ."
";
} else {
echo "". l('contact_not_sent') ."
";
echo "". l('message_error') ."
";
echo "". l('backhome') ."
";
}}}
and replace it with:
// CONTACT
function contact() {
if ($_POST['contactform'] == "") {?>
echo l('contact'); ?>
}
if (isset($_POST['contactform'])) {
$to = s('website_email');
$subject = s('contact_subject');
$body = l('name') .": ". $_POST['name'] ."n";
$body .= l('email') .": ". $_POST['email'] ."n";
$body .= l('url') .": ". $_POST['weblink'] ."nn";
$body .= l('message') .": ". $_POST['message'] ."n";
if (strlen(clean($_POST['name'])) > 1 AND strlen(clean($_POST['message'])) > 1) {
if ($contact_mail_just_sent != 1) {
mail($to, $subject, $body);
$contact_mail_just_sent = 1;
echo "". l('contact_sent') ."
";
echo "". l('backhome') ."
";
};
} else {
echo "". l('contact_not_sent') ."
";
echo "". l('message_error') ."
";
echo "". l('backhome') ."
";
}}}
^_^
