Valery Posted May 12, 2017 Share Posted May 12, 2017 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 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