WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have migrated to WordPress from other (probably unknown to you) free blogging site (bloguje.cz if you are curious)

The issue is, that previous system had sometimes URL ending with ".php" and sometimes not. So external links to my page can look both ways:


I decided that on Wordpress, all my pages will have custom URL containing ".php" at the end.

And now I am facing the fact, that some users can sometimes receive "404" page when going to my site from the "another example" link.

So i would like to "tweak" my 404 page to contain all the words from URL in search result and search for it. So it would contain "another example" as searched item.

I am using WordPress installation downloaded from czech community page - (everything translated into Czech) and default theme - Twenty Eleven 1.2

share|improve this question

WordPress doesn't deeplink to any php file for the front end. Instead, everything is passed throug the url as a query, like so http://your-blog-url.com?p=123.

If you wanted to change that behaviour, you could edit your permalink structure in multiple ways. Just go to settings->permalinks (i have no idea what that is in czech, but its the last entry in settings) and edit away. you could set the permalink structure to /%postname%.php for example, it would output something like http://your-blog-url.com/some-post-name.php this wouldnt however actually link to a php file, its just a fake. but it would probably keep visitors from running into a 404 in the first place.

IMHO it's better practice to make the url reflect your blogs structure, like so: /%category%/%postname%, output then being http://your-blog-url.com/some-category/some-post-name

as for tweaking the searchform, goto wp-content/themes/twentyten/404.php and edit to your likings. hope this is helpful to you, cheers :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.