Guest User

Untitled

a guest
Oct 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. $ wp site option get subdomain_install
  2. 1
  3.  
  4. $ wp site option get illegal_names
  5. array (
  6. 0 => 'www',
  7. 1 => 'web',
  8. 2 => 'root',
  9. 3 => 'admin',
  10. 4 => 'main',
  11. 5 => 'invite',
  12. 6 => 'administrator',
  13. 7 => 'files',
  14. 8 => 'blog',
  15. )
  16.  
  17. RewriteEngine On
  18. RewriteBase /
  19. RewriteRule ^index.php$ - [L]
  20.  
  21. # add a trailing slash to /wp-admin
  22. RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
  23.  
  24. RewriteCond %{REQUEST_FILENAME} -f [OR]
  25. RewriteCond %{REQUEST_FILENAME} -d
  26. RewriteRule ^ - [L]
  27. RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
  28. RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
  29. RewriteRule . index.php [L]
  30.  
  31. RewriteEngine On
  32. RewriteBase /
  33. RewriteRule ^index.php$ - [L]
  34.  
  35. # add a trailing slash to /wp-admin
  36. RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
  37.  
  38. RewriteCond %{REQUEST_FILENAME} -f [OR]
  39. RewriteCond %{REQUEST_FILENAME} -d
  40. RewriteRule ^ - [L]
  41. RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
  42. RewriteRule ^(.*.php)$ $1 [L]
  43. RewriteRule . index.php [L]
  44.  
  45. // patch-forbidden-slugs.php
  46. <?php
  47. $illegalNames = get_metadata( 'site', SITE_ID_CURRENT_SITE, 'illegal_names', true );
  48. $blogSlug = 'blog';
  49. if ( in_array( $blogSlug, $illegalNames ) ) {
  50. exit( 'Noting to do' . PHP_EOL );
  51. }
  52. $illegalNames[] = $blogSlug;
  53. update_metadata( 'site', SITE_ID_CURRENT_SITE, 'illegal_names', $illegalNames );
  54. exit( 'Done' . PHP_EOL );
Add Comment
Please, Sign In to add comment