i need this url return to my main page.... mysite.com i use this for empty id or wurl to return to error page
if($_GET["wurl"]!=""){
}else{
header("Location: /404NotFound.php");
exit();
}
what i do for this url to return to my main page or error page
http://www.mysite开发者_如何转开发.com/Toni-Michelle-Braxton-4618html
???
I'm taking a wild guess and assume the code snippet is your rewriterule handler. (That's what the last comment suggests). If so, then you might already succeed with:
if (!strstr($_GET["wurl"], ".html")){ //or just "." instead of ".html"
exit(header("Location: /404NotFound.php"));
}
Try that before your existing if
block. Should it not work, say so, and someone else can make a lucky code suggestion.
PS: It would be better if you just tested for the existence of the files. (I also surmise you do an unfiltered include there..)
精彩评论