php - Internal Error when file does not exist -


I should meet everything "/" and merge with ".php"

OK Works, but when the file does not exist, I get an internal error

  Rewrite rules ([^ \ /] *) $ 1.php  
< / Div>

You may want to see that to avoid a loop, before you write it again, Want to rewrite (note that your test pattern that you write back to ). A possible approach to this is to do the following:

  # Check that the file is a directory wristwatch% {REQUEST_FILENAME}! -d # is not ... nor is it a file that rewrite% {REQUEST_FILENAME}! -f # ... but the result of rewriting will be the revoked code% {DOCUMENT_ROOT} / $ 1.php -f rewrite rule ^ ([^ /] +) $ 1.php  

In this case, there is a (minor) advantage of showing the original URL where 404 is generated, provided you are using the share Apache error message if you want to rewrite a non-existent PHP file, then the server Says that /something.php was not found in place of / something / , but since then no rewrite Is used when the target file does not exist, you receive instead / something / .

If you still get a 500 error, then there may be another conflicting rule in your .htaccess file. You should also see Apache's error log for more detailed information about the error, although in this case I suspect that it had crossed an internal redirection boundary message.


Comments