in .htaccess
RewriteEngine On
RewriteRule ^([a-zA-Z0-9-]+)$ /phpweb/shorturl/redirection.php?links=$1
and in redirection.php
I have made a codes that take links as a get parameters
and query to find a url based on that get parameter
if query unmatched so it redirect to index.php page
it is working for all match cases but not for unmatched cases
my search url is like
http://localhost/phpweb/urltest/php/nonexisturl
this url doesn't exist so it redirect to index.php
but it shows blank page
but it works in redirection.php?links=nonexisturl
this redirect into index.php
htaccess redirect - legacy way Modern applications can redirect themselves index.php endpoint (for backward compatibility).
Обсуждают сегодня