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: (SOLVED) Unable to resolve 404 error  (Read 1690 times)

PeterPerek

  • Newbie
  • *
  • Karma: 0
  • Posts: 6
(SOLVED) Unable to resolve 404 error
« on: March 22, 2011, 09:04:00 am »

HI, I'm new to sNews. I am doing an installation (see http://wadiocese.com/sNews/) and am fine until I click on a link. Then I get an error message: "The requested URL /sNews/uncategorized/ was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request." The name of my sNews folder is "SNews" and here is what I have in my htaccess file:

<IfModule mod_php4.c>
    php_value session.use_trans_sid 0
</IfModule>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
RewriteEngine On
RewriteBase /sNews
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]

Please advise.

Thanks!
PeterPerek
« Last Edit: March 23, 2011, 07:42:17 pm by Keyrocks »
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Unable to resolve 404 error
« Reply #1 on: March 22, 2011, 11:50:24 am »

SNews
or
sNews?
Check the htaccess and the directory.

PeterPerek

  • Newbie
  • *
  • Karma: 0
  • Posts: 6
Re: Unable to resolve 404 error
« Reply #2 on: March 22, 2011, 03:24:52 pm »

sNews

What should I check in the ntaccess? It is in the sNews folder.
I am a newbie: what exactly should I check in the directory (what files)?
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Unable to resolve 404 error
« Reply #3 on: March 22, 2011, 03:51:07 pm »

PeterPerek, make sure that the RewriteBase directive corresponds exactly to the folder (directory) that your sNews files are in. In your case, this:

Quote
RewriteBase /sNews

Should be changed to this:

Quote
RewriteBase /SNews

if the sNews folder is actually named SNews. If it's named sNews, then something else is wrong (case is important here).
I believe that is what Sven was trying to say.

If I may, it might be better to change the folder name to snews (all lowercase), and change the RewriteBase line in .htaccess accordingly (RewriteBase /snews). It's not strictly necessary but it might help avoid confusions.
« Last Edit: March 22, 2011, 03:53:20 pm by Fred K (agentsmith) »
Logged

PeterPerek

  • Newbie
  • *
  • Karma: 0
  • Posts: 6
Re: Unable to resolve 404 error
« Reply #4 on: March 22, 2011, 04:20:42 pm »

I have changed the folder name to "snews" as well as the RewriteBase line in htaccess accordingly. The RewriteBase directive corresponds exactly to the folder (directory) that my snews files are in (see below).

<IfModule mod_php4.c>
    php_value session.use_trans_sid 0
</IfModule>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
RewriteEngine On
RewriteBase /snews
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]

Unfortunately, I still get the error message. Is there anything else I may try?

Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Unable to resolve 404 error
« Reply #5 on: March 22, 2011, 07:31:20 pm »

You could check out this thread for starters. It's hard to tell exactly what's happening, it could be a setup issue with your host or it could be you might need to comment out the first three lines in the .htaccess, or something else. Start by checking that your host allows you to use your own .htaccess file, and if there are special considerations you need to take.
Logged

PeterPerek

  • Newbie
  • *
  • Karma: 0
  • Posts: 6
Re: Unable to resolve 404 error
« Reply #6 on: March 22, 2011, 08:24:16 pm »

My host does allow one to use their own .htaccess file. Besides the IMAGES folder, do any others have to have permissions changed? What does "commenting out the first three lines" of htaccess mean? Any other ideas? Thanks.
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: Unable to resolve 404 error
« Reply #7 on: March 22, 2011, 09:00:23 pm »

My host does allow one to use their own .htaccess file. Besides the IMAGES folder, do any others have to have permissions changed?

I don't think so. You are connecting to your database OK otherwise you would be seeing the "Welcome to sNews 1.7" article that is already in the database as a demo article.

You just need to upload (FTP) to your domain root (publc_html usually) the folders css, images, js, lang, plus the ,htaccess file, index.php file and snews.php file.... and have your .htaccess file working properly.

What does "commenting out the first three lines" of htaccess mean?

Commenting out a line means to disable it so that the server will not parse (read) it.
In an .htaccess file, comment out (disable) a line by adding a # sign to the start of it.
So, to comment out the first three lines they would be:
     #<IfModule mod_php4.c>
     #    php_value session.use_trans_sid 0
     #</IfModule>
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

PeterPerek

  • Newbie
  • *
  • Karma: 0
  • Posts: 6
Re: Unable to resolve 404 error
« Reply #8 on: March 22, 2011, 09:14:21 pm »

Tried the commenting out, no luck. Doesn't seem as if anything is working. Any other suggestions, please?
Logged

PeterPerek

  • Newbie
  • *
  • Karma: 0
  • Posts: 6
Re: Unable to resolve 404 error
« Reply #9 on: March 22, 2011, 09:45:45 pm »

OK. I compared the files in the sNews download with what was uploaded to my server and found that one file was missing: .htaccess! I ulpoaded it and bingo, it works Thank you for your help and guidance.
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: Unable to resolve 404 error
« Reply #10 on: March 23, 2011, 01:58:43 am »

Congrats! Have fun exploring.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: Unable to resolve 404 error
« Reply #11 on: March 23, 2011, 03:29:10 am »

Did you solve the problem?

Try this script I did for community sNews Doctor
Logged
Need a Job on Europe. Linkdin - Facebook / Group

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
(SOLVED) Re: Unable to resolve 404 error
« Reply #12 on: March 23, 2011, 07:41:48 pm »

Yes... he found the problem Rui... he didn't notice that his .htaccess file was not on the host server.  :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU