http status code 404 - how to forcefully send invalid url queries to 404 page - PHP -


i have custom 404 page , working fine pages not exist.

but want show 404 page if query_string found missing/invalid/null url.

how can so?

www.example.com/mypage.php?param1=value1 if(isset($_get['param1']) && $_get['param1'] !='') {    //general code } else {    // here want redirect 404.php } 

also 404 page being accessed directly, , want prevent it.

i solved using include, marco mura suggested in comment.

www.example.com/mypage.php?param1=value1 if(isset($_get['param1']) && $_get['param1'] !='') {    //general code } else {    include "404.php"; } 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -