Kashmir Window
asked 8 years ago

Website loading both version www & non www

Now i found the code which is creating problem

Is it safe to remove this code

“`
// Prevents double posts on second page

add_filter(‘redirect_canonical’,’pif_disable_redirect_canonical’);

function pif_disable_redirect_canonical($redirect_url) {
if (is_singular()) $redirect_url = false;
return $redirect_url;
}
“`

1 Answers
DominicStaff
answered 8 years ago

Firstly, please contact your hosting and check the hosting configure, or you can add the following code to your .htaccess

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]

RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Powered by DW Question & Answer Pro