Support » How-To and Troubleshooting » [Resolved] Problem with 404.php

[Resolved] Problem with 404.php

  • Hello,

    My theme include a 404.php template file. but when I search something that doesn’t exist using default WordPress search engine, I encounter index.php with no post. What should I do if I want to redirect URL to 404.php template?

    I’m running WordPress on a local host. Don’t have a search.php template and I have added code below to .htaccess

    ErrorDocument 404 /wordpress/index.php?error=404

Viewing 2 replies - 1 through 2 (of 2 total)
  • Any idea?

    The 404 error page does not show up when you search for something that does not exist. That only works when someone requests a URL directly which does not exist.

    E.g. http://www.test.com/1234

    If that URL does not exist and you request it, the 404 page is triggered.

    If you want to show something when search does not find anything, you have to modify the search output.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Problem with 404.php’ is closed to new replies.