Camen Design Forum

NNF issue

append delete lionize

hi,
i received the following error message...

404: Page not found
This error is generated when there was no web page with the name you specified at the web site.
Troubleshooting suggestions:
Ensure the page you are linking to exists in the correct folder.
Check your file name for case sensitivity . Index.htm is not the same as index.htm!
Temporarily disable any rewrite rules by renaming your .htaccess file if it exists.

...when i tried to create the first thread after installation of my new forum. additionally, i created a mod.txt file with my moderator names and when i went to sign in with one, i realized that i didn't have a password. now i seemed to be able to sign in without a password and proceeded to create a thread, but once i returned to the forum, although the thread was visible, i got the same error when i try to access it.
seems odd to me that you would create the mod.txt file with names only and no password. how is the moderator able to create and maintain their password. im quite confused.
please note that i also created an about.html (didn't have any visible effect), a config.php and a locked.txt, any of which may be causing the problem i guess. although i followed the instructions carefully when i created each. you can also visit the forum if that will help diagnose the issue by navigating to connect.environmentalist.ca.

thanks for any help you can offer.
S.

Reply RSS

Replies

append delete #1. theraje

seems odd to me that you would create the mod.txt file with names only and no password.

Moderators must be added to Mods.txt *after* they have registered their username. Once the username is registered, it is then safe to add it to Mods.txt. (Passwords are stored in separate files from the Mods.txt file.)

I'm not going to be much help on the other stuff. I'm sure when Kroc swings by he can give you more advice on the other issues you are having!

append delete #2. lionize

okay that makes sense, couldn't figure that one out. thanks.

append delete #3. lionize

so i reinstalled the forum files and did not add any customization files to the folder and i am still getting a 404 error. i then checked the .htaccess file in the web-root folder and it has the following rule...

Options -Indexes

...do you think this is causing an issue with the NNF .htaccess file in the forum sub-folder which has an Options -Multiviews rule?

append delete #4. theraje

The .htaccess file in the NNF folder _should_ override the .htaccess file of its parent directory.

Are you running an Apache server? If so, you may want to look into the httpd.conf file as well, as something in there could be doing one over on you.

append delete #5. Kroc

Hello lionize, thanks for trying out NoNonsense Forum.

Your problem is quite simple.

The .htaccess file is missing, or not enabled on your web-server.

The web server cannot find "/introductions" because this is re-written to: http://connect.environmentalist.ca/thread.php?file=introductions&page=last

The zip file you download for NNF contains an ".htaccess" file which is often invisible on Linux / Unix / Mac platforms. If you can't see the ".htaccess" file in unzipped folder, then find the option to show hidden files for your operating system; the .htaccess file must be copied to the webserver, the same with the other files.

If you have uploaded .htaccess, then the issue is that your webserver does not have it enabled (or does not support it; it's Apache only). Contact your web hosts / administrator or consult their help directory for information on .htaccess and how to enabled it.

Once you have done this, NNF will run without issue. :)

---

A few aside notes:

Options -Indexes

This turns off directory listing so people can’t peek at what's in your folders.

i created a mod.txt file with my moderator names

It's mods.txt, not mod.txt, just in case. Mods.txt lists who is a moderator, it doesn't specify who is registered and what their password is. That is handled for all users, regardless of type, in the users folder. To register yourself as a mod:

1. Make any post in the forum with your desired name and password
(this creates the entry for you in /users; nobody else will then be able to use the same name)
2. Create mods.txt and add the name you just used to it

Hope this helps :)

append delete #6. lionize

thanks guys, i have a question about the install though. should i have uploaded the zip file as is or the files inside after ive unzipped them (which is what ive done).
i will talk to the host about enabling the .htaccess file, but i can see it and i believe that it is enabled automatically because when i had to edit a third .htaccess file for a separate joomla site, it did result in the expected outcome.
i also verified the server is apache and found this in the faq...

Yes, Network Solutions supports .htaccess files on the Unix based platform.
Note
Changes made directly to an .htaccess file used for password protection will not be reflected in the Password Protection section of the Hosting Control Panel
.htaccess files must be uploaded in ASCII mode not binary mode, and the permissions need to be set at 644 (rw-r--r--).
.htaccess files affect the directory they are placed in and all sub-directories.

...the following seems like a possible issue...

.htaccess files must be uploaded in ASCII mode not binary mode

...as i have no clue how to ensure that was done.
finally, my reference to mod.txt was in fact a typo.

thanks again and i will update you once ive spoken to support about enabling the 'source of my nightmare' file.

append delete #7. Kroc

should i have uploaded the zip file as is or the files inside after ive unzipped them (which is what ive done).

You've done the right thing, yes.

The .htaccess file will be in ASCII mode as most FTP software handles this automatically, and defaults to ASCII mode. You can check the settings of your FTP software to see what filetypes are handled as which.

.htaccess files must be uploaded in ASCII mode not binary mode, and the permissions need to be set at 644 (rw-r--r--).

This could be your problem. When you uploaded the .htaccess file, it may not have been given the correct file permissions. Try right clicking the uploaded version of .htaccess in your FTP program and see if there's an option to change the permissions (there usually is).

If the problem persists, contact your host for support.

append delete #8. lionize

so support says that the file is enabled, which leaves me scratching my head. all that appears to be left is the...

.htaccess files must be uploaded in ASCII mode not binary mode

...issue, uploading the unzipped vs zipped files or the possibility that one of the files is corrupt (doubtful).
it just occured to me that maybe my permissions are wrong. the file permissions for all forum folders is 775 and file permissions for all files is 644. is this correct? hopefully not!

append delete #9. lionize

sorry kroc, didn't see your reply b/f posting last message. as you can see, i have the file set to 644 and my ftp software is filezilla, which i will go inspect next.

append delete #10. lionize

okay filezilla setting is ASCII so that is off the table.

append delete #11. kashinath

thank's

append delete #12. friedOREROS

Just a shot in the dark-- could lionize's trouble come from _not_ having the NNF install in a root directory?

Maybe someone could help me try to understand exactly what the rewrite conditions are in .htaccess on lines 84-92 (included below). I'm anything but a regex expert.

$
<IfModule mod_rewrite.c>
	RewriteEngine On
	
	# {...}
	
	# a sub-forum
	RewriteCond %{REQUEST_URI} ^(/(?:[^\./&]+/)+)(?::\d+)?$
	RewriteCond %{DOCUMENT_ROOT}%1 -d
	RewriteRule ^((?:[^\./&]+/)+)(?::(\d+))?$ ?path=&page= [QSA,L]
	
	# a thread
	RewriteCond %{REQUEST_URI} ^(/(?:[^\./&]+/)*[_a-z0-9-]+)(?::\d+)?$
	RewriteCond %{DOCUMENT_ROOT}%1.rss -f
	RewriteRule ^((?:[^\./&]+/)*)([_a-z0-9-]+)(?::(\d+))?$ thread.php?path=&file=&page= [QSA,L]
	
</IfModule>
$

PS @Kroc thanks for the great software; I love the ideas behind it.

append delete #13. Kroc

Understanding RegEx is kind of a must here, a very good website to learn is http://regular-expressions.info

Here's a rough breakdown:

% .htaccess
# a sub-forum
RewriteCond %{REQUEST_URI} ^(/(?:[^\./&]+/)+)(?::\d+)?$
RewriteCond %{DOCUMENT_ROOT}%1 -d
RewriteRule ^((?:[^\./&]+/)+)(?::(\d+))?$ ?path=&page= [QSA,L]
%

L2: find a URL that begins with a string of any letters as long as it doesn't contain `^`, `.`, `/` or `&`, and ends with a slash (that is, a directory name). This pattern can be repeated one or more times for sub-folders. `(?::(\d+))?$` checks for the optional page number at the end, e.g. `/:2`

L3: Check that the folder exists, and is a folder

L4: Repeating the same match as before, build the internal URL for NNF, specifying the path and page number

% htaccess
# a thread
RewriteCond %{REQUEST_URI} ^(/(?:[^\./&]+/)*[_a-z0-9-]+)(?::\d+)?$
RewriteCond %{DOCUMENT_ROOT}%1.rss -f
RewriteRule ^((?:[^\./&]+/)*)([_a-z0-9-]+)(?::(\d+))?$ thread.php?path=&file=&page= [QSA,L]
%

L2: Find a URL that starts with zero or more sub-folders, then a string of letters and numbers, limited to A-Z, 0-9 and underscore / hypen and no file extension on the end, but may optionally end with the page number `forum/my_thread:2`

L3: Test that the specified file exists as an RSS feed

L4: Repeating the pattern before, construct NNF's internal URL specifying the path, filename and page number

append delete #14. friedOREOS

@lionize
Did you ever get your NNF install working? Perhaps you could add a RewriteBase to the .htaccess-- eg, if your files are at any location ~/www/nnf/ on your server and accessed via a non-root URL http://example.com/forum/ then your RewriteBase should be /forum/ so that mod_rewrite places the appropriate relative URLs. I hope this helps.

% .htaccess

RewriteEngine On
RewriteBase /forum/

%

@Kroc
Thanks for the explanation; I now see why those RewriteRules are fairly straightforward.

How much consideration have you given to making a "no mod_rewrite" mode in the PHP? Hey! Stay with me here. I know this is blasphemy. But the only critical function of the .htaccess file in NNF is to rewrite the URLs, so if start.php simply detected the file's absence before constructing the links then NNF could be installed without Apache. IMO, such a mode would allow for the use of an (even more) bare-bones server. Plus, nginx NNF would be pretty awesome.

Don't hesitate to demolish my logic here if I'm missing anything. And by the way, congratulations on your marriage!

append delete #15. Kroc

@friedOREOS Yes, absolutely, a no-htaccess mode is something I am considering. I will look into more once this busy spot is over, but if you have any suggestions let me know here or file issues on GitHub.

The only issues with no-htaccess are these:

1. a central function would need to be added to create all URLs according to htaccess being present or not; that's easy enough to do

2. the users folder would be insecure, so a requirement of running NNF without htacess will be to move the users folder to another private location with a config option to specify where

Looking at NNF, I have an idea to move all NNF-specific files into a single folder, so that there's cleaner separation between NNF and the personal generated content (threads). That way, to run without htaccess, the admin just moves all the files out of the NNF folder and on to root.

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Kroc, Impressed, theraje, Martijn