How to enable mod_rewrite in infinityfree.net

So I want to make a project, well I need .htacsses, when I tried it, it didn’t work. So I tried to make a simple .htacsses, this is the content
RewriteEngine On
RewriteRule ^test.html$ test.php [L]

And in test.php I just filled with simple code hello world, when I tried to open /test.html, I got error 404. What should I do?

What did not work? State clearly

So where is the condition?

Read this?

4 Likes

That’s not a mistake from a technical aspect, if you don’t want RewriteCond, you can do it. There’s nothing wrong with it, Apache will just apply the rule everywhere.

6 Likes

mod_rewrite is enabled by default on our hosting, so that’s not the problem. The code also seems fine at first sight.

A few possible reasons:

  • Please check that the .htaccess file is loaded correctly. Please double check that it’s actually called .htaccess, and that it’s located in the right directory on your account.
  • Please try checking the page in Incognito Mode in your browser. If you opened the page with bad .htaccess rules before, your browser may have cached the 404 redirect and may keep sending you there despite the code having changed.
8 Likes

yo it’s really working, but… how i can delete ?i in my site?

That is the security system, you cannot remove it. It is replaced by a better system in premium hosting.

7 Likes

ohh.. okay, thanks!

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