Codex tools: Log in
Languages: English • 日本語 • Português do Brasil • Русский • 中文(简体) • (Add your language)
| | Ajuda ao Usuário WordPress Referência da Ajuda Contextual - Este artigo é acessado a partir da Ajuda Contextual do WordPress PT-BR.
Procure nosso Fórum Oficial se precisar de mais ajuda sobre este assunto. |
| | Artigo ou Seção com explicações avançadas A seguir, estão explicações ou instruções para administradores de redes ou programadores.
Adicione {{Avançado}} para usar esta caixa. |
Desde a versão 3.0 do WordPress, é possível criar uma rede de sites usando o recurso multisite. Este artigo contém instruções para ajudá-lo a criar uma rede.
Uma rede pode ser muito semelhante a sua própria versão do WordPress.com. Usuários finais de sua rede podem criar seus próprios sites quando quiserem, assim como usuários finais do WordPress.com. Se você não tem nenhuma necessidade de permitir que usuários finais criem seus próprios sites, você pode criar uma rede onde apenas você, o administrador, pode adicionar novos sites.
Uma rede é uma coleção de sites que compartilham uma só instalação do WordPress. Eles também podem compartilhar plugins e temas. Os sites individuais na rede são sites virtuais no sentido de que eles não têm seus próprios diretórios em seu servidor, embora eles têm diretórios separados para envio de mídia dentro da instalação compartilhada, e eles têm tabelas separadas no banco de dados.
Contents |
Comparado com as instalações normais do WordPress, existem mais considerações a levar em conta para criar uma rede. Você precisa decidir se quer usar sub-domínios ou sub-pastas para sua instalação, e também como você quer maneja-las. Trabalhar com uma rede também tem suas diferentes nuances para instalações de temas e plugins (cada site pode ativar ambos mas instalar nenhum).
Este guia descreve como instalar manualmente uma Rede WordPress em sua instalação atual do WordPress.
Por favor, leia pt-br:Antes de Criar uma Rede antes de continuar.
Seu site WordPress precisa ser atualizado quando for criar uma rede. A não ser que seja uma instalação recente e você não tenha nada a perder, por favor faça o backup de seus arquivos e bancos de dados.
Também desative todos os plugins. Você poderá reativa-los novamente após a rede estar criada.
Para ativar o item Instalar Rede no menu, você precisa, antes, definir o multisite no arquivo wp-config.php.
Abra o wp-config.php e adicione a seguinte linha "acima" de onde diz /* Isto é tudo, pode parar de editar! =) */. Se ele não disser isso em lugar nenhum, então adicione a linha em algum lugar acima da primeira linha que comece com require ou include:
define( 'WP_ALLOW_MULTISITE', true );
Você precisará atualizar a página para continuar.
O passo anterior ativa o item "Instalar Rede" no menu "Ferramentas". Clique nesse item para ir para a tela "Criar uma Rede de Sites WordPress".
Para ver um exemplo da tela "Criar uma Rede de Sites WordPress", olhe em Administration > Tools > Network Setup. A tela nem sempre é a mesma. O exemplo mostrado é para uma instalação no localhost, o que restringe as opções disponíveis.
estricts the options available.
Endereços dos Sites em sua Rede
Você tem a escolha entre sub-domínios e sub-diretórios, exceto quando as configurações existentes restringem sua escolha.
Você precisa escolher uma das duas. Você poderá reconfigurar suas rede para usar a outra opção após a instalação, apesar do aviso que aparece na tela, mas reconfigura-la pode não ser fácil.
Você só precisa de um DNS curinga para a instalação de sites sob demanda baseados em domínio, apesar do aviso que aparece na tela.
See also Before You Begin.
Network Details
There are filled in automatically, but you can make changes.
Double-check the details and press the Install button.
Note: The installer may perform a check for wildcard subdomains when you have not configured them yet, or when you do not need them at all. Ignore the warning if it does not apply to your network. See Server Requirements above for information about wildcard subdomains.
To enable your network, follow the instructions on the Create a Network of WordPress Sites screen. The instructions that you see are customized for your installation. They might not be the same as the examples you see here.
Back up your existing wp-config.php and .htaccess files, unless this is a fresh install and you have nothing to lose.
There are three steps:
wp-content directory.
wp-config.php file
.htaccess file
.htaccess file, then create it in the same directory as your wp-config.php file.
After completing these steps, log in again using the link provided. You might have to clear your browser's cache and cookies in order to log in.
At the left of your WordPress toolbar, My Sites is now the second item. There, all your sites are listed, with handy fly-out menus, as well as a Network Admin menu item. Under Network Admin you can use the Dashboard item to go to the Network Dashboard screen.
Go to the Settings Screen to configure network options, and the Sites Screen to manage your sites.
For more information, see: Network Admin
Upgraded and can't find the Network Admin menu?
Here are some additional things you might need to know about advanced administration of the network.
By design, all users who are added to your network will have subscriber access to all sites on your network. To allocate a different default role for users on individual sites, you must use a plugin, such as Multisite User Management.
The capabilities of the site administrator role are also reduced in a WordPress Network. Site admins cannot install new themes or plugins and cannot edit the profiles of users on their site. Only the Network Admin (aka Super Admin) has the ability to perform these tasks in a WordPress network.
While permalinks will continue to work, the main site (i.e. the first one created) will have an extra entry of blog, making your URLs appear like domain.com/blog/YYYY/MM/POSTNAME.
This is by design, in order to prevent collisions with SubFolder installs. Currently there is no easy way to change it, as doing so prevents WordPress from auto-detecting collisions between your main site and any subsites. This will be addressed, and customizable, in a future version of WordPress.
Also note that the blog prefix is not used for static pages which will be accessible directly under the base address, e.g. domain.com/PAGENAME. If you try to create a static page in the first site with the name of another existing site on the network, the page's permalink will get a suffix (e.g. domain.com/PAGENAME-2). If you create a new site with the slug of an existing static page, the static page will not be reachable anymore. To prevent this, you can add the names of your static pages to the blacklist so that no site with that name can be created.
WordPress Plugins now have additional flexibility, depending upon their implementation across the network. All plugins are installed on the network dashboard's plugin page, and can be activated per-site or for the entire network.
All themes are installed for the entire network. If you edit the code of one theme, you edit it for all sites using that theme. You can install the plugin WordPress.com Custom CSS to allow each site to tweak their own CSS without affecting anyone else. You can activate themes for the entire network, or edit sites and activate them individually.
By default, WordPress assigns "Twenty Eleven" as the theme for all new sites. This can be customized by adding a line like define('WP_DEFAULT_THEME', 'classic'); to your wp-config.php file, where 'classic' is replaced with the folder name of your theme.
It's possible to switch between domain-based (sub-domain) and path-based (sub-directory) installations of Multisite. If you have had WordPress installed for longer than a month and are attempting to activate the network, you will be told to use Sub-domain sites. This is in order to ensure you don't have conflicts between pages (i.e. example.com/pagename ) and sites (i.e. example.com/sitename ). If you are confident you will not have this issue, then you can change this after you finish the initial setup.
In your wp-config.php file, you'll want to change the define call for SUBDOMAIN_INSTALL:
define( 'SUBDOMAIN_INSTALL', true );
define( 'SUBDOMAIN_INSTALL', false );
You'll also have to change your .htaccess to the new setup.
Note that per the Settings Requirements you cannot switch from Sub-directory to Sub-domain when running on 127.0.0.1 or localhost. This can potentially cause an endless loop of reauth=1 on your root site due to cookie handling.
To enable mod_rewrite to work within an Apache Virtual host you may need to set some options on the DocumentRoot.
<VirtualHost *:80>
DocumentRoot /var/www/vhosts/wordpress
<Directory /var/www/vhosts/wordpress>
AllowOverride Fileinfo Options
</Directory>
Unlike Single Site WordPress, which can work with "ugly" Permalinks and thus does not need Mod Rewrite, MultiSite requires its use to format URLs for your subsites. This necessitates the use of an .htaccess file, the format of which will be slightly different if you're using SubFolders or SubDomains. The examples below are the standard .htaccess entries for WordPress SubFolders and SubDomains, when WordPress is installed in the root folder of your website. If you have WordPress in it's own folder, you will need to change the value for RewriteBase appropriately.
As a reminder, these are EXAMPLES and work in most, but not all, installs.
SubFolder Example
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
# END WordPress
SubDomain Example
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
# END WordPress
Issues with old WPMU installs
If you installed Wordpress MU in subfolder/subdirectory (not in root folder on your server via ftp) and you have problem with image library, where thumbnails and images do not show, you may need to manually add in rewrite rules for your file directories as follows:
RewriteRule ^([_0-9a-zA-Z-]+/)?siteN/files/(.+) wp-content/blogs.dir/N/files/$2 [L]
Put those below the normal call for uploaded files.
The Network Admin Link has moved with each major release of WordPress, as this is still a work in progress. Depending on which version of WordPress you are using, the link can be found in the following locations:
When you've created your WordPress Network for importing other sites, you need to look at the Migrating Multiple Blogs into WordPress Multisite article.