Site not found using subdomains

This is a DNS problem, not WordPress. ping test.onlinebanter.co.uk displays unknown host. WordPress does not even handle the requests because the client is unable to determine the IP address of the server and therefore does not send the HTTP request. ping www.onlinebanter.co.uk works, so I assume the name server did not properly store the DNS … Read more

Multilanguage site with two domains

I recently answered a very similar question. Instead of having 2 separate websites, it’s far easier to install a translation plugin. The plugin will basically add extra fields or tabs in edit mode. For example, if you are editing a page titled “Home”, you will have a field for the English page title and then … Read more

multisite: global menu containing network site links?

[*] get_sites() will get a list of the sites in a Multisite network. You can then use switch_to_blog()[*], get_posts() / get_pages(), and restore_current_blog()[*] to get the pages from the various sites. I’d strongly recommend storing the results as a sitewide option using update_site_option() to lessen the load on your server. You could add a job … Read more

web.config breaks the themes for sub-directory multisite

I asked our hosting provider for help and they modified the first web.config to work. <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <system.webServer> <!– <security> <authentication> <basicAuthentication enabled=”false”/> <anonymousAuthentication enabled=”false”/> </authentication> </security>–> <rewrite> <rules> <rule name=”WordPress Rule 1″ stopProcessing=”true”> <match url=”^index\.php$” ignoreCase=”false” /> <action type=”None” /> </rule> <rule name=”WordPress Rule 2″ stopProcessing=”true”> <match url=”^([_0-9a-zA-Z-]+/)?files/(.+)” ignoreCase=”false” /> <action type=”Rewrite” … Read more

Making 2 WordPress sites mutually searchable and more

The online resources I’ve read suggest this will allow me to use different plugins and themes on the two sites whilst allowing a search from either site to bring up results from both sites. Is this correct? Yes, is correct. In multisite environment you can install different plugins/themes for different sites. Once the database is … Read more

How to change home or site url using action hooks or filter?

Ok. Then you can use template_redirect hook and wp_is_mobile() conditional tag. wp_is_mobile() will work on device only. If you resize the window then it will not work. Now you can try this kind of code in your functions.php file add_action(‘template_redirect’, ‘redirecting_to_mobile_site’); function redirecting_to_mobile_site(){ if( wp_is_mobile() ){ wp_redirect( ‘http://m.example.com’, 301 ); exit; } }

add_rewrite_rule on multisite doesn’t work

It seems the problem is not with add_rewrite_rule rather with the .htaccessfile for the multi site. One of the test addresses was http://example.com/foobar/def/whatever.php Here’s a part of the htaccess which causes the result (Line 2) RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L] If I comment this line out it works … Read more