I want the following:
www.bla-bla.com/ --> www.bla-bla.com/php/index.phpwww.bla-bla.com/php/index.php --> www.bla-bla.com/php/error.phpI have tried the following but doesn't work
RewriteEngine on
RewriteRule ^/?$ /php/index.php [S=1]
RewriteCond %{REQUEST_URI} =/php/index\.php
RewriteRule (.*)? /php/error.php [R=404]
What can I do to deny access from real path?
URL=http://localhost
(3) [perdir C:/xampp/htdocs/] strip per-dir prefix: C:/xampp/htdocs/ ->
(3) [perdir C:/xampp/htdocs/] applying pattern '/php/index\.php' to uri ''
(3) [perdir C:/xampp/htdocs/] strip per-dir prefix: C:/xampp/htdocs/ ->
(3) [perdir C:/xampp/htdocs/] applying pattern '^(/?)$' to uri ''
(2) [perdir C:/xampp/htdocs/] rewrite '' -> '/php/index.php'
(1) [perdir C:/xampp/htdocs/] internal redirect with /php/index.php [INTERNAL REDIRECT]
(3) [perdir C:/xampp/htdocs/] strip per-dir prefix: C:/xampp/htdocs/php/index.php -> php/index.php
(3) [perdir C:/xampp/htdocs/] applying pattern '/php/index\.php' to uri 'php/index.php'
(3) [perdir C:/xampp/htdocs/] strip per-dir prefix: C:/xampp/htdocs/php/index.php -> php/index.php
(3) [perdir C:/xampp/htdocs/] applying pattern '^(/?)$' to uri 'php/index.php'
(1) [perdir C:/xampp/htdocs/] pass through C:/xampp/htdocs/php/index.php
URL=http://localhost/php/index.php
(3) [perdir C:/xampp/htdocs/] strip per-dir prefix: C:/xampp/htdocs/php/index.php -> php/index.php
(3) [perdir C:/xampp/htdocs/] applying pattern '/php/index\.php' to uri 'php/index.php'
(3) [perdir C:/xampp/htdocs/] strip per-dir prefix: C:/xampp/htdocs/php/index.php -> php/index.php
(3) [perdir C:/xampp/htdocs/] applying pattern '^(/?)$' to uri 'php/index.php'
(1) [perdir C:/xampp/htdocs/] pass through C:/xampp/htdocs/php/index.php
Options +FollowSymlinks RewriteEngine on
RewriteRule /php/index\.php /php/error.php [L]
RewriteRule ^(/?)$ /php/index.php [QSA,L]
Wtf is going on here?
use
ErrorDocument 404 /php/error.php
in .htaccess file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With