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

1 Answer 1


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 :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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