Jump to content

Recommended Posts

Posted

I've launched a new site with the Redirects module installed. The old site had url's like index.php?pid=8 etc. and I've setup redirects for these to the new site pages. However it doesn't work - if you you enter the url as above it no matter what value pid has for an old page it always takes you to the home page of the new site. Any ideas what the problem is with this?

Posted

Well redirects only working for "real" urls like "yoursite.com/home.html". Not for IDs in queries (the part behind "?").

What you could do is to add a switch to your index page (probably home.php in the templates folder):

<?php

switch($input->get->pid) {
	case '1':
	$session->redirect('http://thenewpage.com/newpath/'); // this will happen if pid in URL is 1
	break;
	case '8':
	$session->redirect('http://thenewpage.com/anotherpath/'); // this will happen if pid in URL is 8
	break;
	
}
  • Like 4
Posted

Thanks - that works but will this be considered as 301 redirects?

Never mind, I see that $session->redirect is a 301 redirect. Thanks again for the quick response and help. This will work fine for this site.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...