Jump to content

Redirects from index.php


jsantari
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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