View Full Version : 404 script - yathyo
yathyo
Sun 20th Aug '06, 5:39pm
Hi all!
I have problems with 404.php:
In my host I have to use this code in the .htaccess for the 404.php script:
ErrorDocument 404 http://www.domain.com/forums/404.php
I also have debugged the 404.php and $_SERVER["REQUEST_URI"] returns forums/404.php, so the scripts returns no action.
How can I solve the action problem :confused:
Jerry
Sun 20th Aug '06, 5:46pm
Your host forces you to use their 404 script, or just to use the .htaccess to define which 404 script ?
yathyo
Sun 20th Aug '06, 6:12pm
I can define my own .htaccess to define error documents.
If I use this code in .htaccess it doesnt works:
ErrorDocument 404 404.php
I contacted the hosting support and they told me that I have to use this:
ErrorDocument 404 http://www.domain.com/forums/404.php
I'm using a server with Cpanel installed.
Jerry
Sun 20th Aug '06, 6:22pm
If you have to use .htaccess as the webserver won't pass it naturally, then I don't believe you will be able to use this solution.
yathyo
Sun 20th Aug '06, 6:28pm
OK Jerry, I will contact hosting provider.
I also need to know how to import the forum without loose the old threadID.
Thanks for your help ;)
Jerry
Sun 20th Aug '06, 6:37pm
I also need to know how to import the forum without loose the old threadID.
That cannot be done, ImpEx will never impose id's on vBulletin data.
yathyo
Sun 20th Aug '06, 6:40pm
Ummmmmm, then how 404.php can redirect to the right one thread if have different ID's?
Jerry
Sun 20th Aug '06, 6:55pm
Ummmmmm, then how 404.php can redirect to the right one thread if have different ID's?
Because is stores the old threadid as importthreadid and then uses the old one to look up the new.
yathyo
Sun 20th Aug '06, 6:56pm
I solved the .htaccess adding this lines at the file:
RewriteRule viewforum.php 404.php [L]
RewriteRule viewtopic.php 404.php [L]
RewriteRule profile.php?mode=viewprofile&u=([0-9]+) 404.php [L]
RewriteRule about([0-9]+).html$ 404.php [L]
Hope it will be usefull to other users ;)
About the aboutxxxxx.html, original code doesnt works to me, so I turned to this:
if (strpos($_SERVER['REQUEST_URI'], "/{$old_folder}/about") === 0)
{
if(preg_match('#(.*)about(.*).html#Uis', $_SERVER['REQUEST_URI'], $matches))
{
if (is_numeric($matches[2])) //When I tried with a high thread ID is_int doesnt works
{
$action = 'thread';
$sql = "SELECT threadid FROM {$tableprefix}thread WHERE importthreadid=" . $matches[2];
}
}
}
Powered by vBulletin™ Version 4.0.0 Beta 4 Copyright © 2009 vBulletin Solutions, Inc. All rights