GithubHelp home page GithubHelp logo

suluredirectbundle's Introduction

SuluRedirectBundle

Official Sulu Bundle Badge

GitHub license GitHub tag (latest SemVer) Test workflow status Sulu compatibility


The SuluRedirectBundle adds simple but powerful capabilities for managing redirects to Sulu’s administration interface and allows content managers to manage redirects without any knowledge of web servers.


SuluRedirectBundle Slideshow


The SuluRedirectBundle is compatible with Sulu starting from version 2.0. Have a look at the require section in the composer.json to find an up-to-date list of the requirements of the bundle.

🚀  Installation and Documentation

Execute the following composer commands to add the bundle to the dependencies of your project:

composer require sulu/redirect-bundle

Afterwards, visit the bundle documentation to find out how to set up and configure the SuluRedirectBundle to your specific needs.

💡  Features

Importing redirects

One of the great features of this bundle is the ability to import redirects from a CSV file. The most simplified file just contains two columns, source and target. Of course, all the other options like statusCode, sourceHost, and enabled can also be set in the import file.

It’s also possible to override existing redirects with an import; you just have to set the same value for source.

Enabling and disabling redirects

Sometimes it’s necessary to prepare redirects which are not ready yet, especially if you have a large number of redirects. Of course there’s a solution for that — toggler in the toolbar to enable or disable redirects quickly. This allows you to import a large number of disabled redirects and then check them in the administration interface, before enabling them when needed.

Different statuses

The SuluRedirectBundle comes with three different statuses to be used for redirects:

  • 301 Moved permanently
  • 302 Moved temporarily
  • 410 Gone

Those status codes are explained in detail here.

Automatic Gone redirects

This bundle also adds the possibility to automatically create redirects with status 410 Gone, if a page or a entity with a route has been removed. This is very useful, because now search engines know, that this page has been deleted.

Route Priorities

Redirects created via this bundle will only be used if no other route matches the given URL. This ensures that accidentally created or imported redirects do not affect existing pages. If a redirect matches the URL of an existing page, the redirect will only be effective after the page was unpublished.

In combination with the SuluAutomationBundle, this behaviour makes it possible to precautionarily create a redirect for the URL of an existing page that will be unpublished at a specified time in the future by the SuluAutomationBundle.

❤️  Support and Contributions

The Sulu content management system is a community-driven open source project backed by various partner companies. We are committed to a fully transparent development process and highly appreciate any contributions.

In case you have questions, we are happy to welcome you in our official Slack channel. If you found a bug or miss a specific feature, feel free to file a new issue with a respective title and description on the the sulu/SuluRedirectBundle repository.

📘  License

The Sulu content management system is released under the terms of the MIT License.

suluredirectbundle's People

Contributors

alexander-schranz avatar choonge avatar d3vpunk avatar danrot avatar emilvooo avatar flogado avatar kleinkoerkamp avatar luca-rath avatar mamazu avatar niklasnatter avatar optior avatar prokyonn avatar trickreich avatar wachterjohannes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

suluredirectbundle's Issues

Redirect .html url with hostSource

Q A
Bug? yes
New Feature? no
Sulu Version 2.4
SuluRedirect Version Specific version or SHA of a commit
Browser Version Browser name and version

Actual Behavior

When I make a redirection from a source with .html extension, the redirect is available only if I don't specify sourceHost.

Expected Behavior

Redirect properly when defining a sourceHost.

Steps to Reproduce

source : test.html
sourceHost: your host or 127.0.0.1:8000
target : /

=> 404

source : test.html
sourceHost: empty host
target : /

=> It's 👍

Add import toolbar action

Q A
Bug? no
New Feature? yes
Sulu Version for 2.0
SuluRedirect Version for 2.0
Browser Version Browser name and version

Actual Behavior

In 1.x version of the redirect bundle there did exist a import overlay.

Expected Behavior

This should be reimplemented in for 2.0 when sulu provides a ImportToolbarAction:

sulu/sulu#4621

Add enable/disable toolbarAction

Q A
Bug? no
New Feature? no
Sulu Version for 2.0
SuluRedirect Version for 2.0
Browser Version -

Actual Behavior

Currently the enabled/disabled is implemented as checkbox in the form.

Expected Behavior

As noted by @chirimoya things like enabled/disabled or published/unpublish should be a toolbar action and should call an own api endpoint which does just enable and disable this redirect.

Lowercasing target URL can lead to non-working redirect

Q A
Bug? yes
New Feature? no
Sulu Version 2.4.0
SuluRedirect Version 2.0.2
Browser Version -

Actual Behavior

Since #63 the redirect bundle lowercases all target URLs, which can make the whole redirect useless depending on whether the target application's URLs are case sensitive or not.

Expected Behavior

The target URL is adopted as it is entered.

Steps to Reproduce

Add a redirect to e.g. a Spotify playlist URL (which is case sensitive). When opening the source URL, the Spotify page you get redirected to will load forever or show an error page.

Possible Solutions

Remove the mb_strtolower call for the target URL.

Would you accept this change or would this be considered a BC break?

Add translations to crowdin

Q A
Bug? no
New Feature? yes
Bundle Version develop
Sulu Version 2.0.3

Actual Behavior

So that it's translatable

Information for uploading imports

Q A
Bug? no
New Feature? yes

On this moment there is no information how the import is working. You can upload a csv file but you dont know what is needed for this import.

Is it possible to give feedback/information to the user how this redirect functionality is working?

Update:
Removed permissions info.

Add export toolbar action

Q A
Bug? no
New Feature? yes
Sulu Version 2.x
SuluRedirect Version 2.x

Actual Behavior

Currently there is no export toolbar action and that is probably a bit confusing for users who want to import redirects, because they have no template at all about how the import csv file should look like.

Expected Behavior

There should be a export toolbar action

Removing of the deserialization

Q A
Bug? yes
New Feature? no
Sulu Version 1.6.27, 2.0.0-RC1
SuluRedirect Version 0.2.2, dev-develop
Browser Version -

Actual Behavior

The deserialization does skip and setter/getter and can overwrite changer, creator, ids which is a security issue how it is currently implemented.

Expected Behavior

Use the serializer just to serialize object to json but not json to object use normal setters instead.

Use link field type for redirect target

Q A
Bug? no
New Feature? no
Sulu Version Specific version or SHA of a commit
SuluRedirect Version Specific version or SHA of a commit
Browser Version Browser name and version

Actual Behavior

Currently the redirect target is just a absolute url or absolute path.

Expected Behavior

It would be nice to redirect always to a specific page also when the page url changes. This could be done by using the link field type instead a text input.

Can't delete redirects

Q A
Bug? yes
New Feature? no
Sulu Version 1.6
SuluRedirect Version 0.1.1

Actual Behavior

Currently its not possible to delete redirects as the remove button is never activated.

Expected Behavior

The remove button should be enabled when a checkbox is marked in the list to remove a specific item.

Automatically add slash or validate input

Q A
Bug? no
New Feature? no
Sulu Version 1.6.0-RC1
SuluRedirect Version 0.1.1

Actual Behavior

Currently you can create a redirect rule e.g. source test.html which is invalid as it can never map as the slash is required /test.html.

Expected Behavior

Automatically add the / when saving or writing the url or validate it in the frontend.

Steps to Reproduce

Create rule with source test.html.

Possible Solutions

See expected behavior.

Tag 2.0 version

Q A
Bug? no
New Feature? yes
Sulu Version 2.0
SuluRedirect Version 2.x
Browser Version All

Actual Behavior

Now it's not possible to install this bundle without change stability of composer to dev.

Expected Behavior

Install via composer with a stable version

Steps to Reproduce

composer require sulu/redirect-bundle ( with a clean install of sulu skeleton )

Possible Solutions

Tag a 2.0 version for Sulu. I don't know if something is missing or it's planned a release date ( if so, close this issue ) . If i can help, please tell me

Multi webspace support not guaranteed

Q A
Bug? no
New Feature? no
Sulu Version 1.6, 2.0.0-RC1
SuluRedirect Version 0.2.2, dev-devleop
Browser Version -

Actual Behavior

Currently there is no multi webspace / domain support. You can redirect to a specific domain but the source can not have a domain.

Expected Behavior

There should be an additional sourceHost property which should be set by the GoneSubscriber ({host} host will be replaced with null which is the same as matching for all domains). SourceHost can be empty so it will match all domains. If a source exist in both with and without a sourceHost it should use the redirect with the host.

Deleting a Page fails if "Gone on remove" is enabled

Q A
Bug? yes
New Feature? no
Sulu Version -
SuluRedirect Version 2.0.0
Browser Version -

Actual Behavior

If gone on remove is enabled and you try to remove a page in admin it fails.

GoneDocumentSubscriber try to save the page https://github.com/sulu/SuluRedirectBundle/blob/2.x/GoneSubscriber/GoneDocumentSubscriber.php#L100

but saveBydata method fails due to missing 'sourceHost' key

https://github.com/sulu/SuluRedirectBundle/blob/2.x/Manager/RedirectRouteManager.php#L41

Expected Behavior

The page is removed and redirect is created .

Possible Solutions

  • Add coalescence operator in 'sourceHost'
  • Refactor method to set all arguments with typehints (BC break)

404 url list and redirect creation

Mostly when you create a new website you can not create for all old urls redirects.
It would be good to have a 404 url list in the backend foreach webspace with a counter (which urls was called most) and the content manager create a redirect to a specific page / url.

Add Dutch translations

Q A
Bug? no
New Feature? yes
Sulu Version 1.6
SuluRedirect Version 0.1.3

Actual Behavior

Does not have Dutch language

Import file without header line

Q A
Bug? no
New Feature? no
Sulu Version 0.1.*
SuluRedirect Version ---
Browser Version ---

Actual Behavior

When importing a file without header line (source,target) the import fails foreach line without message.

Expected Behavior

The import should work or fail with an accurate error message.

Steps to Reproduce

Upload csv file without header line.
image

Possible Solutions

There are two possible solutions:

  1. use source,target as default header and try to import
  2. detect this issue and return an accurate error message

Implement securitycontext

Q A
Bug? no
New Feature? yes
Sulu Version none
SuluRedirect Version all
Browser Version none

Actual Behavior

The security-context currently only implement the VIEW permission.

Expected Behavior

This should be extended to ADD, EDIT, DELETE, UPDATE.

Gone subscriber can't be disabled

Q A
Bug? yes
New Feature? no
Sulu Version 1.6.21
SuluRedirect Version 0.2.0

Actual Behavior

Gone subscriber can't be disabled.

Expected Behavior

Gone should be able to be disabled currently the service is always loaded.

Steps to Reproduce

Try to disable the gone subscriber over the configuraiton

Possible Solutions

Load gone_subscriber.xml only when enabled.

Case-Insensitive unique key

Q A
Bug? no
New Feature? no
Sulu Version 0.1.3
SuluRedirect Version 1.6.6
Browser Version none

Actual Behavior

Currently the unique key for source is case insensitive (by mysql default). This leads into that the redirect for /test will also work for /Test and the import will only allow one of them (but redirect both).

This has impact on the following code snippets:

Expected Behavior

That should be discussed.

Possible Solutions

Do Nothing to keep case-insensitive unique-key or mark key as BINARY to make it case-sensitive.

Could not import CSV file

Q A
Bug? yes
New Feature? no
Sulu Version ~2.4.2
SuluRedirect Version ^2.1
Browser Version Google Chrome Version 108.0.5359.125

Actual Behavior

Only tried in Google Chrome Browser

Import a CSV file with the two columns "source" and "target" result an error of:
The intl string context variable "fileName" was not provided to the string "Unexpected error while uploading {fileName, select, undefined{a file} other{the file {fileName}}} to the server."

Expected Behavior

Importing a CSV file with those two columns should be possible according to the docs.

Steps to Reproduce

Create a CSV file with the required columns "target" and "source" and try to import it.

Screenshots

image

Support new list filter configuration

Q A
Bug? yes
New Feature? no
Bundle Version dev-develop
Sulu Version 2.1.*@dev
Browser Version

Actual Behavior

It throws an error on the filter-type attribute. See: https://github.com/danrot/sulu/blob/89512c37e28213b4a386cfef8e1eba4838e7220f/UPGRADE.md

Expected Behavior

Sulu redirect bundle should work with Sulu 2.1.*@dev

Steps to Reproduce

Use the sulu redirect bundle in a project with Sulu 2.1.*@dev

Possible Solutions

Remove the filter-type attribute for now. In the UPDATE.md it states that this attribute is not yet in use at all. I will make a PR for this.

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.