Jump to content

Migrating URLs starting with index.php


Valery
 Share

Recommended Posts

Hi everybody!

I am migrating a Joomla site and I am having troubles with Joomla's URLs.

Joomla links look like this: www.example.com/index.php?option=com_content&view=article&id=80

I have set up my prependTemplateFile to detect GET variables that Joomla uses, and redirect to PW pages:

// Example: index.php?option=com_content&view=article&id=80
if ($input->get('option') && $input->get('id')) {
    $j_article_id = $input->get->int('id');
    $target = $pages->findOne("j_migration_id=$j_article_id"); // `j_migration_id` is the field where Joomla IDs are stored     
    if ($target->id != 0) {
        $session->redirect($target->url());        
    }    
    else {
        $session->redirect($target->url());        
    }
}

The problem I am having is this: the above code works fine with any template but home.php

But when a Joomla URL is called from the root of the site, PW simply redirects to the root page.

For instance, www.example.com/index.php?option=com_content&view=article&id=80 redirects me to www.example.com

While www.example.com/some-page-with-custom-template/index.php?option=com_content&view=article&id=80 does what expected: redirects to the right page (e.g. www.example.com/some-page-with-custom-template/some-page/)

The question is: does either the root page or the home template have there any exceptions for GET variables processing?

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...