The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
404 / 301 after import redirect on import ids Details »» | |||||||||||||||||||||||||||
404 / 301 after import redirect on import ids
Developer Last Online: Oct 2010
After importing from a source board there will be internal and external links that point to the old URLS.
During the import the origional import id's are kept (for one import) so a redirect can be calculated to find the new user/forum/thread/post, by looking up the old import{$type}id. ImpEx currently alters the table to add the import id, though a planned future version will have this separated so multi-import sites can be managed, The original discussion thread on vBulletin.com : http://www.vbulletin.com/forum/showthread.php?t=178161 It is advised that $do_404 = false; is set so the 301 is sent with the new URL to update search engines. The script needs setting up and customising to each site as the domains and URLs can be different. Show Your Support
|
Comments |
#22
|
||||
|
||||
The only thing I can think is finding the web server logs to see the exact request coming in and seeing what it is trying to parse.
|
#23
|
|||
|
|||
I have a very simple problem with this mod. Why the script needs to be run for every single link?
We have three cases: 1. accessing a bookmarked or spidered link like www.example.com/oldforum/index.php. That /oldforum/ directory no longer exists, ofcourse. 2. click on an older link when browsing the new, vbulletin forum; 3. An ordinary link like example.com/test.htm, or example.com/contact.htm. In all cases this mod is run, and i think it's not ok. First a root .htaccess must be setup, doing a redirect of all requests from /oldforum/ to /newforum/. THEN, in the /newforum/ you can put a second .htaccess that redirects to 404.php and starts running the script. In that way you don't parse every single link, but just the ones you are interested in. Am I correct? For now, the only way to do this 404.php working, is to put the .htaccess in the root folder, and parse the 404.php file every single time, even with the links with no relations to the old, erased forum. Or, you can keep the /oldforum/ directory, and put inside a .htaccess to permanently redirect all requests to the /newforum/, where we have this 404.php file... |
#24
|
||||
|
||||
You can set up the rest as you wish, if the link isn't found it defaults to the standard 404 file, if you want to parse the content to find if it's old forum or not before the script that's just another way of doing it, you can .htaccess and only direct old forum links to it if you want, that would lower the dB load onto the webserver.
This script is just an example and works for most, though not the only and de facto way of doing it. The resulting 301 will update the search engines over time as it is. |
#25
|
|||
|
|||
Quote:
Anyway, it's a great feature for future impex releases! At least support for 2-3 forums like phpbb, invision, etc. |
#26
|
||||
|
||||
Since I don't have ready access to the domain name server, I tried to put a .htaccess redirect on the "from" board and hoped that the vBulletin board would capture the inbound requests and redirect them.
The redirect experiment did not go well. I could not get the behavior I was looking for on either end. This is the contents of the .htaccess file located on the bbv2 site: Code:
# bbv2 assigns .boy .pm and .cgi to the cgi-script handler in Apache # Trailing slash references to nawcc-mb.com/bbv2/ AddHandler cgi-script .boy .pm .cgi DirectoryIndex bbBoard.cgi bbBoard.cgi # vBulletin message board has a 404 redirect to map bbv2 references to vBulletin references # The bbBoard.cgi reference will be trapped by the 404 handler on mb.nawcc.org - disable until ready Redirect permanent /bbBoard.cgi http://mb.nawcc.org/bbv2/bbBoard.cgi I put the 404 trap handler on mb.nawcc.org and edited the .htaccess file there to read: Code:
ErrorDocument 404 /var/www/html/404t.php php_flag log_errors on php_value error_log /var/www/html/php_error.log I tried changing the path for 404t.php to just "/" and to nothing but the file name as well as the form shown in the code box. References to the old board are not redirected, they just display the old board. If I edit the reference on my browser address line to substitute the new board address, I just get a 404 error. If I directly reference mb.nawcc.org/404t.php, the debug message prints when I turn on debug. With debug off, I get a 500 error, but nothing in the php error log. Can someone tell me how the .htaccess files should be set up? I am stuck at this point. |
#27
|
||||
|
||||
I have the trap handler working on the new board. If I copy a url from the old board and edit the domain to be the new board everything works as expected.
However, I still have not figured out how to get the old board to do the redirect. The directive looks so simple, but it is not working. The contents of the .htaccess file on the old system is in the post just above this one. I have looked in httpd.conf and I can't see anything that would prevent the redirect from working. The behavior is that references to the old message board look totally unchanged and just invoke whatever page is referenced. |
#28
|
|||
|
|||
Hi Jerry. There is an error at line 92.
Quote:
Quote:
|
#29
|
||||
|
||||
Just a follow up to close my problem discussion.
The .htaccess file needed to be in the web root directory in order to redirect traffic. I was confused because the old message board software had an .htaccess in the top of the message board directory (one below the root) that was catching references and doing a cgi handler. In any case it is working fine now. Attempts to reference the old board get redirected to the new board (different site) where the trap handler interprets them and delivers the correct thread or forum. We had this board installed on May 22nd and will be finally going live on Sep 3rd. |
#30
|
|||
|
|||
Could somebody help me for modifying the script for SMF 1.1.5? I'm using "search engine friendly URLs" so they should be pretty easy to parse for someone who knows what they are doing (I clearly don't)
Forums look like this: http://mysite.com/index.php?board=5.0 Threads look like this: http://mysite.com/index.php/topic,775.0.html Posts look like this: http://mysite.com/index.php/topic,54...2.html#msg3252 In addition, I'm not fully sure how to RUN/OPERATE this? There is a 404.php and it tells you to add a line in your new forum/db but how do you execute/initiate everything? Thanks in advance for your help! |
#31
|
||||
|
||||
I have been working on this for a different source system than yours, but I may be able to offer a couple of tips.
1. You need to be able to parse off the old id code for anything you want to serve on redirect. Your forum and thread links appear to be exactly the same and neither has an identifier, so I don't think those will do you any good. Perhaps you copied the wrong thing. 2. The 404 trap program needs to find the code from the old reference that was translated to an equivalent code in the vBulletin system. In your case this looks like either the numeric part of the topic .html file name or the message number in that file. In either case if you can find a unique string that ALWAYS preceded the critical identifier, you can use the php intval function to return that number as show in the examples in Jerry's 404 program. The number or numbers you get by this technique need to be the ones that ImpEx previously deposited in the ImportID column of the Thread, Forum or Post table. When you have these numbers you can use them in mySQL queries to find out what the equivalent number is in vBulletin. If you have never done any programming in PHP or any other language, you probably have little chance of accomplishing any of this. If you have had some basic programming experience, you should be able to follow it with a fair bit of work. Once the 404.php program is built to do the translation trick, you need to use .htaccess to call the program when your web site would have reported a 404 File not Found error. The .htaccess file needs to be in the directory that is trying to display the missing file. Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|