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

Create redirect on alias update #27

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open

Create redirect on alias update #27

wants to merge 8 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 19, 2012

Added the ability for redirects to be created whenever a resource alias has changed. This will help none-technical users who aren't familiar with setting up 301 redirects or forget it's importance. The redirect will only be created if a record for that resource does not already exist. This can be enabled/disabled via system settings if required.

  • Modified build.transport.php to support two new events, OnDocFormRender and OnDocFormSave
  • Modified plugin.redirector.php to capture alias prior to save (OnDocFormRender). If the alias has changed and the system settings permit then add a new redirect record (OnDocFormSave)
  • Created new system setting: redirector.on_alias_update (Yes/No)
  • Updated readme.txt

…nder and OnDocFormSave

- Modified plugin.redirector.php to capture alias prior to save (OnDocFormRender). If the alias has changed and the system settings permit then add a new redirect record (OnDocFormSave)
- Created new system setting: redirector.on_alias_update (Yes/No)
- Updated readme.txt
@Mark-H
Copy link

Mark-H commented Nov 19, 2012

It looks like you accidentally committed the change of the sample build configs to your local build configs, may want to try and correct that if you can :) Also looks like you added a changelog entry to the readme instead of the changelog file?

@ghost
Copy link
Author

ghost commented Nov 19, 2012

Thanks for noticing those. I'll get them corrected and committed. I wasn't sure if it was my place to change the changelog.txt file, but I will do now you've suggested it.

@ghost
Copy link
Author

ghost commented Nov 20, 2012

Thanks Mark, I've made those changes now.

@jpdevries
Copy link

This looks like an awesome feature. I'm working on merging some PRs into the new location at modxcms/Redirector. Would love some help coming up to with some tests to make sure it is ready.

@bertoost
Copy link

Manually merged in to new version.. PR on modxcms soon!

Also; renamed setting to "track_uri_updates" and made it combo-boolean type. Tracking alias changes only isn't enough. Because when you have/child/pages/ Redirector need to have the whole path instead of the alias of the resource itself.

rtripault pushed a commit to rtripault/Redirector that referenced this pull request Jan 24, 2015
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

Successfully merging this pull request may close these issues.

4 participants