OVAS

General Community Forums => Website and Forum Issues => Topic started by: RossW on June 25, 2011, 07:35:12 PM

Title: Old Links Are Broken
Post by: RossW on June 25, 2011, 07:35:12 PM
Do you think the old links will ever work again?

All of my saved URLs, and google results, do not work.

Please don't take this as a slam.  This upgrade has been awesome, and you support beyond awesome!!!
Title: Re: Old Links Are Broken
Post by: OVAS-Webmaster on June 25, 2011, 08:35:20 PM
Quote from: RossW on June 25, 2011, 07:35:12 PM
Do you think the old links will ever work again?
No.  During the upgrade the forum moved locations - one of the side effects of this move is all the old links are no longer valid.

More details...
The old forum was loaded in the root of our web site (www.ovas.ca), to help clean things up the new forum in is www.ovas.ca/forum - where it should be.  Eventually the homepage will be moved from www.ovas.ca/ovas (where it had to be because the old forum was in the root) to www.ovas.ca.  Currently there is a redirect from www.ovas.ca to www.ovas.ca/ovas
Title: Re: Old Links Are Broken
Post by: bt on June 27, 2011, 01:44:58 PM
Do you have direct DB (presumably MySQL) access?  If so (though possibly dependent on the table structure - easier if all posts are stored in the same table), you could use an update query and the replace() function to change ovas.ca/index.php to ovas.ca/forum/index.php across all posts.

Update {table}
set {post field} = replace ({post field},'ovas.ca/index.php','ovas.ca/forum/index.php')

Now there may be something about the setup here that makes this a lot more difficult, but that code should work for most forum setups out there if it's running on MySQL 5.0 or above.

Of course, it won't fix bookmarks or links from Google or other websites.
Title: Re: Old Links Are Broken
Post by: magnosis on June 30, 2011, 01:19:23 AM
Quote from: bt on June 27, 2011, 01:44:58 PM
Of course, it won't fix bookmarks or links from Google or other websites.

A good approach for this is a mod-rewrite statement in the .htaccess file (your need Apache's mod_rewrite enabled):


RewriteEngine on
RewriteRule ^index.php?topic=([0-9.]+)$ /forum/index.php?topic=$1


This way the server will route all http requests
from (old) http://ovas.ca/index.php?topic=xxxxx.x
to (new) http://ovas.ca/forum/index.php?topic=xxxxx.x
.. with absolutely no meddling of the data.