17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1352 Views |
-
permanent redirections

30 May 2007 at 10:03am Last edited: 30 May 2007 11:24am
Hi Folk
I am rebuilding a site from straight html to a silverstripe application. I would like to setup automatic redirects for the old pages. In the database, I noticed the legacyUrl field. How can I use that? There are 137 pages so a "global" solution would be best.
Any help much appreciated.
Cheers
Nicolaas
-
Re: permanent redirections

2 June 2007 at 6:21pm
I think that the LegacyURL field is something for a specific site that accidentally got put into the main codebase! :-P
Are the old URLs in any consistent format? Your two basic solutions are setting up RedirectorPage pages with the old URLs, if the are of the form http://www.mysite.com/(url)/
If they are mostly in a couple of directories, you could set up director rules that point to a custom controller that does the redirection.
For example, if you have a bunch URLs of the form http://www.mysite.com/products/(XXX).html,
you could set up a director rule
'products/$ProductURL' => 'ProductRedirector'
and then make a class
class ProductRedirector extends Controller {
function index() {
// do something with $this->urlParams['ProductURL'];
}
} -
Re: permanent redirections

5 June 2007 at 10:40am
Hi Sam
thank you for your reply. you should keep the legacyUrl, it is USEFUL!
Anyway, this is how I did it (dirtiest hack of the month):
http://www.silverstripe.com/general-discussion/flat/1361#post1361
| 1352 Views | ||
|
Page:
1
|
Go to Top |

