url Canonicalization for wordpress site -


i have website drwagenberg.com can open on both urls

http://www.drwagenberg.com/ http://drwagenberg.com/ 

tried different methods redirection in .htacess file here code .htacess file

redirect 301 / http://www.drwagenberg.com/ # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{http_host} ^drwagenberg\.com$ [nc] rewriterule ^(.*)$ http://www.drwagenberg.com/$1 [l,r=301] </ifmodule> # end wordpress 

i want cannoniclize url http://drwagenberg.com/ whenever user type url automatically makes http://www.drwagenberg.com/ keep in mind website built in wrodpress.

<ifmodule mod_rewrite.c>       rewriteengine on   rewritecond %{http_host} !^www\.   rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l] </ifmodule> 

try this. , rid of top line

redirect 301 / http://www.drwagenberg.com/ 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -