simple problem - function to get path of request on 404 page

MikeyLikesIt - October 25, 2006 - 00:13

I assume this is a very simple task.

I'm launching a new site for my client, and the intial launch will not contain all the content from the old site. Until I migrate all the content from the old site to the new one, I am hosting their old site on a sub domain and want to be able to provide a link on the 404 "page not found" page. Once the content is migrated, this address would simply redirect with a 301 to the appropriate page on the new site.

I am planning to change the settings page custom 404 to point to a page in which I will place a PHP snippet.

The snippet would capture the path and append it onto the domain for the old sites subdomain, allowing the user to access the content on the old site in the interim of the migration process.

I search api.drupal.org, but couldn't see the function to call for this very simple task.

Once I have the path, I can also break it down to redirect the users towards the appropriate sections on the new site.

Thanks

That's a nice idea. Just

dvessel - October 25, 2006 - 00:46

That's a nice idea. Just checked api.drupal.org and found it. It's "request_uri()".

http://api.drupal.org/api/4.7/function/request_uri

joon

Thanks, but

MikeyLikesIt - October 25, 2006 - 01:25

That's the function I was looking for. Thanks. Now the problem is that he default 404 page setting on admin/settings -> error handling , doesn't seem to be working.

I created a new page (node/68) and put some intro text and this simple snippet:

<?php
print request_uri();
?>

and then specified node/68 as the default 404 on the admin/settings page.

When I go to a url that doesn't exist I still ge the default 404 page with no content.

Any Ideas?

Thanks

None whatsoever.. I just

dvessel - October 25, 2006 - 15:23

None whatsoever.. I just tried it on my test site and it prints out fine.

http://beta.dvessel.com/pointing_to_nothing/

joon

integrate with search 404?

MikeyLikesIt - October 25, 2006 - 00:51

Do you think this could be integrated with the Search 404 module? The link to the old site would be more important, but the search of the new site would be a nice feature.

My basic understanding is

dvessel - October 25, 2006 - 00:59

My basic understanding is that it will search with each word between "/". Well, if the old urls are descriptive with them slashes then it could work out. I never played with it since everything in my site is "node/##" making it useless.

Tell us how it works out.

joon

 
 

Drupal is a registered trademark of Dries Buytaert.