Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: R1mP3x on September 06, 2012, 06:08:54 PM

Title: Website help
Post by: R1mP3x on September 06, 2012, 06:08:54 PM
Hello!
I recently created a forum for my  website with SMF again and i still love it.
But i have two questions.
My forum is part of my main website and everytime i type in mywebsite.com/forum
It brings me to Index of /forum
How can i remove this page so it takes me straight to the forum.
And also. Is there anyway of removing the .php on the end of the website? I think you have to do something to the .htaccess
Thank you!
R1mP3x
Title: Re: Website help
Post by: MrPhil on September 06, 2012, 06:30:40 PM
Check that you actually installed SMF into /forum, and not some directory deeper down. This directory will have Settings.php, SSI.php, and index.php, among other files. If you used a "one button" installer, it might have automatically created a directory under the one you specified.

Are you saying that it works if you explicitly type in /forum/index.php? That would suggest that your .htaccess is messed up. Is there an entry in it for DirectoryIndex? It should list index.php as one of the "index" files it searches for if you don't give a file name. Also, as a general rule, your .htaccess should have
Options -Indexes
so that users don't see the index (it's a minor security risk).

It is possible to remove .php or replace it with .html. This falls under the heading of "Security through Obfuscation", and would be done in .htaccess. Can I assume that if you can get index.php to run automatically, that you wouldn't feel any need to do this?
Title: Re: Website help
Post by: R1mP3x on September 07, 2012, 12:27:46 PM
My SMF website is install in Public_html/forum and i manually installed it.
I added Options -Indexes to the .htaccess in the packages file if thats the right place.
If this helps i have a picture.
(http://i48.tinypic.com/fy1vug.png)
Title: Re: Website help
Post by: MrPhil on September 07, 2012, 12:36:46 PM
The .htaccess with the Options -Indexes would be either /.htaccess (affects the whole site) or /forum/.htaccess (only affects the forum).

Now, if you enter http://yoursitename.net/forum (or /forum/) you get the listing of files now (or a 404 with Options -Indexes)? It works fine if you add index.php to the URL? It sounds like your server configuration is messed up. Please attach or list your /.htaccess and /forum/.htaccess files -- we need to see you if have bad content in them, or there's something in SEO or other URL rewriting that's wrong. You can **** out anything that looks like confidential information, such as your domain name or a user name or a server name.
Title: Re: Website help
Post by: R1mP3x on September 07, 2012, 03:10:51 PM
I only have a whole site .htaccess. The /forum doesnt have a .htaccess if thats bad.
And here is my whole site .htaccess

(http://i49.tinypic.com/2cxa54.png)

Thanks
Title: Re: Website help
Post by: Colin on September 07, 2012, 04:23:05 PM
DirectoryIndex home.html is your problem -- remove that.
Title: Re: Website help
Post by: Kindred on September 07, 2012, 04:33:29 PM
actually, that whole htaccess file is crap and is not needed... get rid of everything except the 404 line (if you actually even use a the error.html file)
Title: Re: Website help
Post by: MrPhil on September 07, 2012, 06:00:09 PM
The DirectoryIndex line says to look only for home.html if no file is given in the URL.  Normally it's something like
DirectoryIndex  index.html index.htm index.php home.html

The two big rewrite sections don't look terribly useful. If a requested URL is not a file or directory, add .html to it. Then if it's still not valid, add .php to it (while probably leaving the .html on it!).

It's OK to have the .htaccess in the root (/). It will apply to any directory under it (anything on the site as well as (usually) any subdomains or add-on domains). You are free to add additional .htaccess files in lower level directories, if you need to fine tune you site. They will be evaluated from the root down the chain of subdirectories.

I agree that you should get rid of everything but the ErrorDocument line. Check that you have a valid /error.html page.
Title: Re: Website help
Post by: R1mP3x on September 07, 2012, 06:31:25 PM
Ok i had the directory index to send it to my homepage. but i will just rename it back to index. dunno why i changed it.
And the big rewrite sections were to remove the ending e.g-example.com/test.html would become example.com/test
But i will try thanks
Title: Re: Website help
Post by: Kindred on September 07, 2012, 09:11:13 PM
get rid of it. It's not needed.

none of that is needed and is sure to cause you problems eventually
Title: Re: Website help
Post by: ARG01 on September 08, 2012, 01:17:25 AM
Quote from: Kindred on September 07, 2012, 09:11:13 PM
get rid of it. It's not needed.

none of that is needed and is sure to cause you problems eventually

I second that. :)
Title: Re: Website help
Post by: R1mP3x on September 08, 2012, 08:50:23 AM
Everything in .htaccess deleted except my directory index to send me to the homepage and my error code.
Still have to type in /index.php, any help?
Title: Re: Website help
Post by: mashby on September 08, 2012, 10:12:30 AM
What's on your directory index line? Mind providing a link to your site?
Title: Re: Website help
Post by: MrPhil on September 08, 2012, 11:54:55 AM
You're not understanding how DirectoryIndex works.
DirectoryIndex  home.html
tells the server to only look for "home.html", if no file is given. If you use DirectoryIndex, you must give the entire list to look for.

If you want home.html to be looked for first, use
DirectoryIndex home.html index.html index.htm index.php
Title: Re: Website help
Post by: Kindred on September 08, 2012, 01:10:20 PM
why do you even want that directory index.  If your forum is the main point of your site, then you don't need it...
If you have a file called home.html, rename it to index.html and move on without that crap in your htaccess....

Title: Re: Website help
Post by: R1mP3x on September 08, 2012, 04:58:48 PM
I had it as index.html but i wanted the search bar to say /home
and ok.
Quote from: mashby on September 08, 2012, 10:12:30 AM
What's on your directory index line? Mind providing a link to your site?
Its a work in progress ATM
beatdowntest.net46.net
And i will rename home, to index and delete directory index. and tell you what happens
Title: Re: Website help
Post by: R1mP3x on September 08, 2012, 05:29:41 PM
Renamed home to index and changed it all /forum works!
Thanks!
But one last question
My website:
http://beatdowntest.net46.net (http://beatdowntest.net46.net)
The ending still says .html on the end,
Is there anyway or hiding that and keeping everything working?
Title: Re: Website help
Post by: Kindred on September 08, 2012, 11:38:24 PM
ummmm.... no...and why would you even bother?  .html tells the server and the browser what kind of file it is.
Title: Re: Website help
Post by: R1mP3x on September 09, 2012, 08:50:23 AM
Its just annoying as if i want to type in the website i sometimes forget to add .html but thanks,
Ill mark this as solved.
Title: Re: Website help
Post by: Kindred on September 09, 2012, 10:53:12 AM
If you just type in the website URL, without index.html, you will still get index.html, if it s present.