News:

Wondering if this will always be free?  See why free is better.

Main Menu

Website help

Started by R1mP3x, September 06, 2012, 06:08:54 PM

Previous topic - Next topic

R1mP3x

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 [nofollow]
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

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?

R1mP3x

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

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.

R1mP3x

I only have a whole site .htaccess. The /forum doesnt have a .htaccess if thats bad.
And here is my whole site .htaccess



Thanks

Colin

DirectoryIndex home.html is your problem -- remove that.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Kindred

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)
Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

MrPhil

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.

R1mP3x

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 [nofollow] would become example.com/test [nofollow]
But i will try thanks

Kindred

get rid of it. It's not needed.

none of that is needed and is sure to cause you problems eventually
Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

ARG01

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. :)
No, I will not offer free downloads to Premium DzinerStuido themes. Please stop asking.

R1mP3x

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?

mashby

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

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

Kindred

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....

Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

R1mP3x

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

R1mP3x

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?

Kindred

ummmm.... no...and why would you even bother?  .html tells the server and the browser what kind of file it is.
Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

R1mP3x

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.

Kindred

If you just type in the website URL, without index.html, you will still get index.html, if it s present.
Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: