.htaccess rules not working

I’m creating a video archival website based on a famous blog.
However, since files uploaded can’t be larger than 10 MB (and this is based on larger video files) I created an .htaccess file in htdocs, and set up some RewriteRules to a media server with videos.
However, they don’t work; visiting a page defined by a RewriteRule just returns a 404.
Why is this the case?

It looks like the .htaccess file is getting deleted whenever I try to save it.
This is frustrating.
Can anyone here know why this is happening?


The InfinityFree web servers have size limits for all files. If the file size exceeds the limit, the file is automatically deleted.

The size limits are:

  • HTML and PHP files are limited 1 MB.
  • .htaccess files are limited to 10 kB.
  • All other files are limited to 10 MB.

In addition to the points made above:

What kind of rewrite rules are you using? The kind which redirects visitors to the media server? Or the kind that tries to proxy the requests to the media server? Because we don’t allow the latter (the bandwidth use of such proxies is way too much).


the file was larger than 10 kb. i will let you know if it works once i make it smaller.
admin, RewriteRule is a 301 or 302 redirect (not a proxy)

Made the RewriteRules smaller than 10 kb, and added the line ‘RewriteEngine On’ at the top.
It now works fine. Thank you for your help!


Glad that you got it solved :smiley:

1 Like

You can proxy with rewrite rules using the P flag. It’s blocked on our server though.

And you wouldn’t be the first to say they’re using rewrite rules while using completely different modules.


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