Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • Place RewriteRule ' ^/$ /index.php [R,L] ' to the end. Commented Nov 20, 2020 at 19:24
  • 1
    @RedaSalih That accomplishes nothing and rather restores the File not Found problem for the website root. Even when removing the L[ast] flag so rule checking continues. Commented Nov 22, 2020 at 19:31
  • 1
    @RedaSalih The [L] flag will only prevent the underlying rules from being applied in the current iteration. However, Apache iterates over and over again from the beginning until the URL stops changing. In this case (and in general), it takes more than one iteration, so your solution will not work. Commented Nov 23, 2020 at 0:36
  • @dr_ I have tested your code in my localhost and works fine. http://localhost/ stays the same, and http://localhost/foo.php redirects to http://localhost/foo/. Maybe share the full code? Commented Nov 23, 2020 at 19:58
  • @mateleco Done, post edited. Commented Nov 24, 2020 at 12:40