Redirect WordPress MS to no-www version, excepting some dirs and prefixes

<IfModule mod_rewrite.c> RewriteEngine on #If whe’re using www. RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] #prefixes to !^ ignore RewriteCond %{REQUEST_URI} !^/host RewriteCond %{REQUEST_URI} !^/aprobar RewriteCond %{REQUEST_URI} !^/wp-admin RewriteCond %{REQUEST_URI} !^/wp-login.php #See at the end about index.php RewriteCond %{REQUEST_URI} !^/index.php RewriteRule ^(.*)$ http://%1/$1 [R=301,L] </IfModule> When you’re using permalinks, WordPress do something like this to get the content: … Read more

Cannot retrieve home url with custom queries

home_url() uses get_home_url() which in turn uses get_option( ‘home’ ) to retrieve the home url. The code in get_option() includes this: // If home is not set use siteurl. if ( ‘home’ == $option && ” == $value ) return get_option( ‘siteurl’ ); I didn’t unwind all the previous code in the function, but it … Read more