I want WWW domain prefix
-
Almost everything is nice – the only thing that was not satisfactory is the fact that plugin developers assumed that I don’t like the www prefix, and that I want it to be removed. This is not true – I want my blog to work the same no matter what visitor enters in the browser address bar: domain.com or https://www.domain.com).
Solution is to change two files:
Solution is to change two files:
In line 55 of file domain_mapping.php, change:
$wpdb->escape( preg_replace( "/^www\./", "", $_POST[ 'domain' ] ) );
to
$wpdb->escape( $_POST[ 'domain' ] );
And in line 112 of the same file, change
echo "https://www.<input type='text' name='domain' value='' />/";
to
echo "https://<input type='text' name='domain' value='' />/";
In line 10 of file sunrise.php, change:
$wpdb->escape( preg_replace( "/^www\./", "", $_SERVER[ 'HTTP_HOST' ] ) );
change to
$wpdb->escape( $_SERVER[ 'HTTP_HOST' ] );
Anyway, when you do that, you just add two domains (www and without-www) for the same blog.
https://www.ads-software.com/extend/plugins/wordpress-mu-domain-mapping/
- The topic ‘I want WWW domain prefix’ is closed to new replies.