Forum Moderators: phranque
I'm coming across a strange issue about canonical fix with my domain.
If I type in the browser address bar my canonical domain name (www.example.com) it works correctly;
If I type in a non canonical request such as example.com, with no-www, it seems to redirect correctly to the canonical domain.
so, you are going to ask me where is the problem...
..If I create a link from another site for non canonical request, redirect doesn't happen and a browser error appears.
that sounds strange to me...am I wrong?
Anyway, I added the canonical fix in my root .htaccess file, along with my existing wordpress settings, but, still,redirect doesn't happens:
My current .htaccess file it's like that:
Options +FollowSymLinks
RewriteEngine on
# Redirect all non-canonical domain requests to requested resource in canonical domain
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
What's wrong with it?
tnx...
[edited by: jdMorgan at 10:11 pm (utc) on Mar. 9, 2009]
[edit reason] example.com [/edit]
WordPress does its own canonical fixing with PHP - what happens when you comment out the canonical redirect section of the above .htaccess file? Also what specific error are you getting? Is the domain name set correctly in the WordPress admin control panel?
Trying to connect to the site trough a non-canonical link the browser returns to me that error:
"Site/address not found"...
(Firefox)
urls in Wordpress settings are correctly set on canonical one.