Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

redirect www to non-www wordpress multisite

######################################################################
## Redirect non-www to www
##
## If you enable this, disable the "Redirect www to non-www" below!
######################################################################
if ($host = 'example.com' ) {
    rewrite ^/(.*)$ http://www.example.com/$1 permanent;
}
######################################################################


Redirect www to non-www


If you enable this, disable the “Redirect non-www to www” above!

######################################################################

if ($host = ‘www.example.com’ ) {

rewrite ^/(.*)$ http://example.com/$1 permanent;

}


######################################################################


Redirect example.org to example.com


Your server_name must include both the old and new domain names!

######################################################################

if ($host ~ “(www.)?example.org$” ) {

rewrite ^/(.*)$ http://www.example.com/$1 permanent;
Source by community.bitnami.com #
 
PREVIOUS NEXT
Tagged: #redirect #www #wordpress #multisite
ADD COMMENT
Topic
Name
7+9 =