automatic read .php url website
So far I haven't seen a working rewriter of /foo/bar into /foo/bar.php, so I created my own. It does work in top-level directory AND subdirectories and it doesn't need hardcoding the RewriteBase.
.htaccess:
RewriteEngine on
# Rewrite /foo/bar to /foo/bar.php
RewriteRule ^([^.?]+)$ %{REQUEST_URI}.php [L]
# Return 404 if original request is /foo/bar.php
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]
# NOTE! FOR APACHE ON WINDOWS: Add [NC] to RewriteCond like this:
# RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$" [NC]
Also in PHP:
- base 64 implementation php
- array exists in php
- 1071 Specified key was t oo long; max key length is 3072 bytes laravel
- db seed in controller
- connect mongodb with php
- check php version linux terminal
- blade if
- auto generate 6 string
- composer in serveur ionos
- datetime object to string php
- exec output php
- Str random laravel 5.8
- descargar laravel
- check if includes numbers php
- .php how to run
- add month from date php
- base64 decode
- How to see if there is a - in a string in php
- download npm package
- define php
- composer won't use php version for subdomain multiphp
- array key exists php
- all words capital php
- composer in laravel