My .htaccess file keeps being removed!

Website URL

[For security reasons, the link will not be disclosed.]

Error Message

.htaccess file keeps being removed.

Other Information

I am installing an .htaccess file that is responsible for both HTTPS redirect, and to remove ?i=1 from the link. The file is 500B, which is 0.5KB, loads (way) under the posted limit here:
Why are my files deleted after uploading them

The .htaccess code is this:

Cool Code
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:CF-Visitor} !{"scheme":"https"}
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{QUERY_STRING} ^i=1$
RewriteRule ^(.*)$ /$1? [R=301,L]
RewriteCond %{QUERY_STRING} ^i=1&(.+)$
RewriteRule ^(.*)$ /$1?%1 [R=301,L]
RewriteCond %{QUERY_STRING} ^(.+)&i=1$
RewriteRule ^(.*)$ /$1?%1 [R=301,L]
RewriteCond %{QUERY_STRING} ^(.+)&i=1&(.+)$
RewriteRule ^(.*)$ /$1?%1&%2 [R=301,L]

Problem is, after I save the file and upload it to the server, it is removed without notice.

Am I stuck to only HTTPS redirect? Is iFastNet removing the file? I would like to drop the ?i=1 after the security system has loaded in.

If you try to hide the i parameter by redirecting through .htaccess, it will trigger the file deletion system for some reason. This happened to me before. I’m not sure if iFastNet did this intentionally or not.

7 Likes

I didn’t even think of doing that. Shame it didn’t work.

4 Likes

Hello,
This should be a good answer, they do this because “InfinityFree is not intended to be used for file sharing, API hosting, database hosting or background tasks/tools.”. I personally HATE this but it cannot be removed, unfortunately.

1 Like

I know, ?i=1 is placed at the end of a URL as part of the security system. I like how the security system is created.

There is a particular system on my site that runs in the background, which has to retrieve a file on the server once in a while. When the _test cookie expires, and the ability to retrieve a file is stopped. To start it again, it involves refreshing the page.

The thing is, if the page is refreshed 3 times because the cookie expired 3 times, the person viewing the site would be greeted with a page saying that Cookies and JS must be enabled.

By clearing ?i=1 after the security system kicks in and the page is starting to load, this incrementing issue is stopped. This doesn’t stop the security system, but this doesn’t bring the inconveniences of the security system either.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.