News:

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

Main Menu

Unexpected blocking of access to SMF site

Started by sbartelski, February 27, 2025, 04:12:13 PM

Previous topic - Next topic

sbartelski

I was working on and around my SMF site when suddenly I could not access the site with a 403 message. I was able to get help from my server provider, who found the foloowing text in the .htaccess file
QuoteThe file adjusts some server-side settings and included these lines:

<Files *>
        Order Deny,Allow
        Deny from all
        Allow from localhost
</Files>

the .htaccess file has been renmaned to .old, why was this code in the file? I have not touched that file today or any other time.
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

Sir Osis of Liver

A clean 2.1.4 install does not include an .htaccess file.  Either you or your host put it there.
Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

Doug Heffernan

Quote from: sbartelski on February 27, 2025, 04:12:13 PMthe .htaccess file has been renmaned to .old, why was this code in the file? I have not touched that file today or any other time.

If you haven't added that file yourself, I would contact the host and ask them about it if I were you.

Sesquipedalian

#3
Quote from: Sir Osis of Liver on February 27, 2025, 04:19:44 PMA clean 2.1.4 install does not include an .htaccess file.  Either you or your host put it there.

This is not entirely correct. Three different .htaccess files with that content are included with SMF. However, those .htaccess files exists within the ./attachments directory, the ./cache directory, and the ./Packages directory, not the forum's root directory. If one of those .htaccess files was somehow moved or copied into the forum's root directory, that would cause problems for sure.

@sbartelski, the file ./attachments/.htaccess should contain the following content:

<Files *>
Order Deny,Allow
Deny from all
Allow from localhost
</Files>

RemoveHandler .php .php3 .phtml .cgi .fcgi .pl .fpl .shtml

Meanwhile, the files ./Packages/.htaccess and ./cache/.htaccess should contain the following content:

<Files *>
Order Deny,Allow
Deny from all
Allow from localhost
</Files>

This content definitely should not be present in ./.htaccess.

If you accidentally moved ./attachments/.htaccess, ./cache/.htaccess, or ./Packages/.htaccess to ./.htaccess, just move it back. Otherwise, edit the files as necessary to make sure their content is what it should be.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Sir Osis of Liver

Quote from: Sesquipedalian on February 27, 2025, 05:58:44 PM
Quote from: Sir Osis of Liver on February 27, 2025, 04:19:44 PMA clean 2.1.4 install does not include an .htaccess file.  Either you or your host put it there.
Three different .htaccess files with that content are included with SMF

Well, yeah, we know about those, and if one of those files is placed in the root it takes the forum down with 403, but why would anyone do that?  Not something that could happen unintentionally, so it must be deliberate.  If OP didn't do it you'd have to be really worried about the host.
Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

Sesquipedalian

He said, "I was working on and around my SMF site when suddenly..." To me, that raises the distinct possibility that he accidentally moved one of those .htaccess files into his forum's root.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Sir Osis of Liver

That occurred to me, and probably is what happened, but can't imagine how it was done.  I've seen people do terrible things to forums, but this is a reach.  You'd have to go out of your way to find those files, and why would you move them?
Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

sbartelski

Thanks to everyone for the comments about my problem. I agree that I may have accidently copied the .htaccess file into the root, but it was definitely not intentional. I will go back and check the .htaccess files in the relevant directories.

As ever, I am blown away by the quick and accurate replies, also that fact the the 'gurus' are very patient with a relative noob like myself. Thnaks again
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

Advertisement: