Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Delete .htaccess per plugin

View delete-htaccess.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: Delete .htaccess
* Description: Deletes the .htaccess file on activation, deactivates itself then.
* Plugin URI: http://wordpress.stackexchange.com/q/58183/73
* Version: 2012.07
* Author: Thomas Scholz
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*
* Delete .htaccess, Copyright (C) 2012 Thomas Scholz
*/
register_activation_hook( __FILE__, 'wpse_58183_delete_htaccess' );
add_action( 'admin_notices', 'wpse_58183_admin_notice' );
function wpse_58183_delete_htaccess()
{
$root = trailingslashit( $_SERVER['DOCUMENT_ROOT'] );
unlink( $root . '.htaccess' );
}
function wpse_58183_admin_notice()
{
echo '<div class="updated"><p><code>.htaccess</code> deleted.<br>Plugin deactivated.</p></div>';
deactivate_plugins( basename( __FILE__ ) );
}
Owner
toscho commented

Download as ZIP file from http://f.toscho.de/delete-htaccess.zip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.