Comments (3)
Good catch.
This happens with Arabic as well; a redirect of: /فوتوغرافيا
(Photography) comes up as a 404 instead of redirecting.
The issue is that the $_SERVER['REQUEST_URI']
sees /🔥-deals
as /%F0%9F%94%A5-deals
, and so the md5 of the two strings is different, to the lookup fails.
str_replace( '%2F', '/', rawurlencode( '/🔥-deals` ) )
...matches $_SERVER['REQUEST_URI']
for a request of /🔥-deals
.
Need to consider at what point in the process is this introduced (Before saving to the DB? On lookup?), and how we maintain backwards compatibility for existing redirects.
from wpcom-legacy-redirector.
@GaryJones We can decode the URL's on lookup which will match with how redirects are currently being stored in the posts table (preserving compatibility with existing + new redirects).
Following worked successfully ...
rawurldecode( $url );
MacBook-Air:WPCOM-Legacy-Redirector bryandwyer$ curl -I "http://rustyincorgchartbdtech.lndo.site/🔥-deals"
HTTP/1.1 301 Moved Permanently
Cache-Control: no-cache, must-revalidate, max-age=0
Content-Type: text/html; charset=UTF-8
Date: Thu, 30 May 2019 19:30:20 GMT
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Location: /sample-page/
Server: nginx/1.14.2
Set-Cookie: XDEBUG_SESSION=www-data; expires=Thu, 30-May-2019 20:30:19 GMT; Max-Age=3600; path=/
X-Frame-Options: SAMEORIGIN
X-Powered-By: PHP/7.2.16
X-Redirect-By: WPCOM Legacy Redirector
OK (8 tests, 16 assertions)
from wpcom-legacy-redirector.
That sounds good - feel free to get a PR going for this!
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
- UI: duplicate redirects when using slug and ID HOT 3
- Remove support for bulk editing HOT 1
- 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.