Comments (3)
@jeremeylduvall Those pesky trailing slashes never go away :)
Thanks for scoping this out and for sharing the provided sample code. I was able to test, validate, and implement automatically supporting both scenarios (with or without the trailing slash). I also included query string compatibility as well and I'll be forking + committing code soon.
from wpcom-legacy-redirector.
@GaryJones Do we want to allow the creation of redirects ($from_url
) for both trailing slash URL variants through the UI? It is currently allowed. This decision impacts how the most optimal solution is implemented for v1.4.0 and supported moving forward.
i.e...
https://example.com/redir
to https://example.com/page1
https://example.com/redir/
to https://example.com/page2
Possible Solutions:
A) Consistent trailing slash agnostic support across the CLI, UI, and internally within the plugin. We'd uniformly consider the example above as one redirect route. Only the CLI can create a trailing slash variant with --skip-validation
. We can apply the trailing slash policy based on the site's current permalink structure.
B) Allow these to operate as separate redirect routes as is allowed today. We'd add logic to maybe_do_redirect()
to support a fallback check on the second possible URL - the trailing slash variant as outlined in this issue. We'd further optimize for performance.
Thoughts? Thank you, sir!
from wpcom-legacy-redirector.
+1 to this. We've had to hack the core plugin code for this use case.
from wpcom-legacy-redirector.
Related Issues (20)
- Introduce Redirect_Code class
- Stop post type being indexed by VIP Search
- Migrate plugin documentation to repo
- Add redirects individually does not work HOT 2
- CLI: insert-redirect fails when using post ID
- Unable to trash redirects to temporarily pause them HOT 5
- Make redirects support different post statuses
- Decouple validation logic HOT 1
- Add validate-csv command
- Can't add redirect when using a self-signed certificate
- Switch from custom edit page, to meta boxes on an Add New page
- Improve Documentation for class-wpcom-legacy-redirector.php HOT 1
- Utilize Constant for Plugin Slug HOT 3
- UI: Relative paths in network subsites misleading previews and bypassed validation HOT 1
- Submit to packagist HOT 1
- Tag a new release for the latest stable version of the plugin HOT 1
- Performance issue caused by wpcom_vip_add_role_caps HOT 5
- Handling AMP redirects and filtering redirect_uri
- Enhance code quality through sonarcloud.io or similar HOT 1
- Allow inserted ID to be returned
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wpcom-legacy-redirector.