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

Automatic rewrite rules #162

Closed
rahul286 opened this issue Mar 25, 2014 · 4 comments
Closed

Automatic rewrite rules #162

rahul286 opened this issue Mar 25, 2014 · 4 comments

Comments

@rahul286
Copy link
Member

For WordPress sites, as site grows old it is cluttered with 301/302 redirects.

Some plugins add these redirects. Some are handled by WordPress core (e.g. slug changes). But in both cases, a request reaches PHP.

Idea is to monitor access.log, say daily for a site, find 301/302 and create rewrite rules for that sites so redirects will be much faster and php/mysql will be saved from some work.

@rahul286 rahul286 added this to the 1.5 - Monitor "Watchmen" release milestone Mar 25, 2014
@rahul286
Copy link
Member Author

Rewrites will use this syntax:

location = old-url-1 { return 301 new-url-1; }

Courtesy: Igor Sysoev - http://forum.nginx.org/read.php?2,248659,248661#msg-248661

@etcook
Copy link

etcook commented Mar 26, 2014

Rahul - this is an incredible idea!

@henrich-m
Copy link

Awesome idea! 👍

@rahul286 rahul286 modified the milestone: 2.3 - Monitor "Watchmen" release Dec 16, 2014
@rahul286 rahul286 added this to the 3.3 - Watchman milestone Mar 18, 2015
@rahul286
Copy link
Member Author

rahul286 commented Aug 3, 2018

Over the time I realized this is not worth the efforts.

The performance saving is minimal since Nginx page cache can store 301/302 responses too. So only first hit will reach PHP.

Having its done via Nginx requires all involved people to ping to Sys team. So we ourself started using https://wordpress.org/plugins/safe-redirect-manager/ . This is a nice plugin 10up and we recommended by redirect handling.

@rahul286 rahul286 closed this as completed Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants