jsantari Posted July 14, 2014 Share Posted July 14, 2014 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 More sharing options...
Nico Knoll Posted July 14, 2014 Share Posted July 14, 2014 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; } 4 Link to comment Share on other sites More sharing options...
jsantari Posted July 14, 2014 Author Share Posted July 14, 2014 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. 1 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted July 14, 2014 Share Posted July 14, 2014 I believe it will. At least it says so here. And just to be sure, check here too. Link to comment Share on other sites More sharing options...
Nico Knoll Posted July 14, 2014 Share Posted July 14, 2014 Here you go: 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now