Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to ignore certain pages in the default context from routing #38

Open
janwidmer opened this issue May 31, 2020 · 1 comment
Open

Comments

@janwidmer
Copy link

Even when having a multi-language website with several context's, some pages maybe only exist once within the default context:

  • UpgradeModx (from the UpgradeModx package)
  • Sitemap

As the XRouting plugin tries to redirect every page, calling these pages leads to a 404 / redirect to default context depending on the settings.

It would be nice, if there would be a system setting to add path's / pages which should be ignored from routing.

I enhanced the XRouting plugin like this:

case 'OnHandleRequest':
	if ($modx->context->get('key') == 'mgr') return;
	
	$requestPath = $_REQUEST[$modx->getOption('request_param_alias', null, 'q')];
	if ($requestPath == 'upgrade-modx.html') return;

This enhancement seems to work. Would you accept a PR?

@christianseel
Copy link
Member

Hey @janwidmer,
while I'd be fine with a system setting like that (maybe comma-separated list of paths), I'd say your default context (the modx "web" context) should also have meaningful context settings (like base_path and http_host). In that case routing should also work there without issues and you would not need the mentioned system settings. (Sorry for the late reply)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants