How would I go about displaying a block on all pages with the url that ends with "/thenameofmypage" or anything that begins with "/thenameofmypage?"

I basicaly want to display the block on the search page and the results page.

I was thinking of something along the lines of this, but not sure about the search results part (with the ?+ at the end)

<?php
$match
= FALSE;
if (
substr($_SERVER["REQUEST_URI"], 0, 10) == '/thenameofmypage')
{
$match = TRUE;}
return
$match;
?>

Comments

On the Block configuration

On the Block configuration page choose "Show block on specific pages: " and just list the pages to show the block on. e.g. "Example paths are blog for the blog page and blog/* for every personal blog."

Thanks for that! I just

Thanks for that!

I just realised that even just

Show block on specific pages:
nameofmypage

Works, I just didn't notice it because my blocks weren't displaying correctly and all sorts of other issues :(

http://drupal.org/node/1889770