/page to /page.php

 RewriteRule ^([az]+)/{0,1}$ $1.php [QSA,L] 

What other variants of such redirection by mod_rewrite could be?

  • What you do not like this option? - Visman
  • @Visman because of it does not work header("HTTP/1.1 404 Not Found"); , more precisely, it works, but no redirection happens: the user remains but the page where this header was called. - Plush
  • So maybe there is no such file? Replace [QSA,L] with [QSA,L,R] and see which page it tries to open. - Visman
  • @Visman so gives Error 403 and in the address bar opens the full path to the file from which the 404 header was sent (this is on localhost) - Plush

1 answer 1

 RewriteRule ^page(/?)+$ /page.php [QSA,L] 
  • page - may differ and contain other characters az - Plush