| 96 | | if (!$wp_rewrite->using_mod_rewrite_permalinks() ) |
|---|
| 97 | | return false; |
|---|
| 98 | | |
|---|
| 99 | | if (!((!file_exists( $home_path.'.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path.'.htaccess' ) ) ) |
|---|
| 100 | | return false; |
|---|
| 101 | | |
|---|
| 102 | | if (! got_mod_rewrite() ) |
|---|
| 103 | | return false; |
|---|
| 104 | | |
|---|
| 105 | | $rules = explode( "\n", $wp_rewrite->mod_rewrite_rules() ); |
|---|
| 106 | | return insert_with_markers( $home_path.'.htaccess', 'WordPress', $rules ); |
|---|
| | 104 | // If the file doesn't already exists check for write access to the directory and whether of not we have some rules. |
|---|
| | 105 | // else check for write access to the file. |
|---|
| | 106 | if ((!file_exists($htaccess_file) && is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks()) || is_writable($htaccess_file)) { |
|---|
| | 107 | if ( got_mod_rewrite() ) { |
|---|
| | 108 | $rules = explode( "\n", $wp_rewrite->mod_rewrite_rules() ); |
|---|
| | 109 | return insert_with_markers( $htaccess_file, 'WordPress', $rules ); |
|---|
| | 110 | } |
|---|
| | 111 | } |
|---|
| | 112 | |
|---|
| | 113 | return false; |
|---|