Giter Site home page Giter Site logo

kctech / xrouting Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sedadigital/xrouting

0.0 1.0 0.0 53 KB

XRouting is a simple plugin that handles requests for different contexts in MODX Revolution. It automatically switches the context based on a (sub)domain AND/OR subfolder.

Home Page: https://modx.today/posts/2015/05/using-xrouting-for-multilingual-websites-in-modx

PHP 100.00%

xrouting's Introduction

XRouting

XRouting is a simple plugin that handles requests for different contexts. It automatically switches the context based on a (sub)domain AND/OR subfolder.

It's like the Gateway plugin from the docs, except you don't have to manually edit the plugin: it takes the http_host and base_url settings you have already configured in your context and routes based on that. It caches the http_host/base_url-to-context relation so it doesn't perform excessive database lookups.

You can also use http_host_aliases to route multiple domains to one context.

Instructions

All you need to do is to install this plugin and make sure your contexts have http_host, base_url, site_url and site_start context settings set.

/!\ Please make sure to add your http_host and site_url without www. if the xrouting.include_www setting is enabled (default!)

System Settings

You can set the following system settings:

  • xrouting.include_www - automatically include www subdomain (default: yes)
  • xrouting.show_no_match_error - set to true to show the error page if no matching context has been found (false will show the default context instead)
  • xrouting.default_context - define the default context if no matching context has been found and xrouting.show_no_match_error is false
  • xrouting.allow_debug_info - activate this setting and add &xrouting-debug=1 to your URL and you will get a handy debug output if your routing isn't working as expected

Troubleshooting

If your context routing isn't working as expected you can active the xrouting.allow_debug_info system setting and add &xrouting-debug=1 to your URL to get a handy debug output. If you can't find any issue in your debug output feel free to open an issue and paste your debug output into the issue.

xrouting's People

Contributors

benjamindean avatar christianseel avatar jako avatar kctech avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.