Advertisement:

Author Topic: Website help  (Read 3495 times)

Offline R1mP3x

  • Semi-Newbie
  • *
  • Posts: 15
  • Gender: Male
  • Yup, thats me.
Website help
« 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

MrPhil

  • Guest
Re: Website help
« Reply #1 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
Code: [Select]
Options -Indexesso 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?

Offline R1mP3x

  • Semi-Newbie
  • *
  • Posts: 15
  • Gender: Male
  • Yup, thats me.
Re: Website help
« Reply #2 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.

MrPhil

  • Guest
Re: Website help
« Reply #3 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.

Offline R1mP3x

  • Semi-Newbie
  • *
  • Posts: 15
  • Gender: Male
  • Yup, thats me.
Re: Website help
« Reply #4 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



Thanks

Offline Colin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,874
  • Gender: Male
  • SMF Developer
    • colinschoen on GitHub
Re: Website help
« Reply #5 on: September 07, 2012, 04:23:05 PM »
DirectoryIndex home.html is your problem -- remove that.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,429
  • Gender: Male
    • Kindred-999 on GitHub
Re: Website help
« Reply #6 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)
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

MrPhil

  • Guest
Re: Website help
« Reply #7 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
Code: [Select]
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.

Offline R1mP3x

  • Semi-Newbie
  • *
  • Posts: 15
  • Gender: Male
  • Yup, thats me.
Re: Website help
« Reply #8 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

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,429
  • Gender: Male
    • Kindred-999 on GitHub
Re: Website help
« Reply #9 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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline ARG01

  • SMF Hero
  • ******
  • Posts: 4,596
  • Dziner-Studio
    • Dziner-Studio
Re: Website help
« Reply #10 on: September 08, 2012, 01:17:25 AM »
get rid of it. It's not needed.

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

I second that. :)
No, I will not offer free downloads to Premium DzinerStuido themes. Please stop asking.

Offline R1mP3x

  • Semi-Newbie
  • *
  • Posts: 15
  • Gender: Male
  • Yup, thats me.
Re: Website help
« Reply #11 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?

Offline mashby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,394
  • Gender: Male
  • badass beer hound
    • Choppix
Re: Website help
« Reply #12 on: September 08, 2012, 10:12:30 AM »
What's on your directory index line? Mind providing a link to your site?
Always be a little kinder than necessary.
- James M. Barrie

MrPhil

  • Guest
Re: Website help
« Reply #13 on: September 08, 2012, 11:54:55 AM »
You're not understanding how DirectoryIndex works.
Code: [Select]
DirectoryIndex  home.htmltells 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
Code: [Select]
DirectoryIndex home.html index.html index.htm index.php

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,429
  • Gender: Male
    • Kindred-999 on GitHub
Re: Website help
« Reply #14 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....

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline R1mP3x

  • Semi-Newbie
  • *
  • Posts: 15
  • Gender: Male
  • Yup, thats me.
Re: Website help
« Reply #15 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.
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

Offline R1mP3x

  • Semi-Newbie
  • *
  • Posts: 15
  • Gender: Male
  • Yup, thats me.
Re: Website help
« Reply #16 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 [nofollow]
The ending still says .html on the end,
Is there anyway or hiding that and keeping everything working?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,429
  • Gender: Male
    • Kindred-999 on GitHub
Re: Website help
« Reply #17 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.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline R1mP3x

  • Semi-Newbie
  • *
  • Posts: 15
  • Gender: Male
  • Yup, thats me.
Re: Website help
« Reply #18 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.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,429
  • Gender: Male
    • Kindred-999 on GitHub
Re: Website help
« Reply #19 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.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.