Last active
August 29, 2015 14:05
-
-
Save ethitter/b5a7896f922a8a3ebd40 to your computer and use it in GitHub Desktop.
WordPress permalink overrides for nginx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Bypass WP's check for Apache's mod_rewrite support | |
* Ensure proper rewrite support is configured in nginx | |
* See http://codex.wordpress.org/Nginx | |
* | |
* @filter got_rewrite | |
* @uses __return_true | |
*/ | |
add_filter( 'got_rewrite', '__return_true' ); | |
/** | |
* Tell WP not to write an htaccess file since nginx doesn't use it | |
* See http://core.trac.wordpress.org/ticket/23491 | |
* | |
* @filter flush_rewrite_rules_hard | |
* @uses __return_false | |
*/ | |
add_filter( 'flush_rewrite_rules_hard', '__return_false' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment