homepage Welcome to WebmasterWorld Guest from 54.196.198.213
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
canonical fix fails
trying to explain why
specter




msg:3866526
 6:43 pm on Mar 9, 2009 (gmt 0)

Hello,

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]

 

g1smd




msg:3866593
 8:04 pm on Mar 9, 2009 (gmt 0)

There's nothing wrong with that code, but there might be something else interfering with it.

However, I don't understand how there can be a difference, unless there's something elsewhere that looks at referrers or something.

encyclo




msg:3866601
 8:09 pm on Mar 9, 2009 (gmt 0)

> there might be something else interfering with it

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?

specter




msg:3866618
 8:35 pm on Mar 9, 2009 (gmt 0)

the canonical fix part in the .htaccess file doesn't change the situation in any way.
It simply makes no difference.

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.

g1smd




msg:3866653
 8:51 pm on Mar 9, 2009 (gmt 0)

What is the status code (use Live HTTP Headers for Firefox, or similar, to see it) returned for those URLs?

[edited by: g1smd at 9:20 pm (utc) on Mar. 9, 2009]

jdMorgan




msg:3866675
 9:18 pm on Mar 9, 2009 (gmt 0)

"Site/address not found"...

Looks like a DNS zone file setup error.

Jim

specter




msg:3866712
 10:01 pm on Mar 9, 2009 (gmt 0)

What is the status code (use Live HTTP Headers for Firefox, or similar, to see it) returned for those URLs?

what exactly should I see? I have a hundreds lines long report...

@jd: what if it is a DNS issue?

specter




msg:3867302
 5:21 pm on Mar 10, 2009 (gmt 0)

...anyone?

g1smd




msg:3867387
 6:44 pm on Mar 10, 2009 (gmt 0)

Out of ideas. Ask your hosts to check things out.

specter




msg:3867435
 7:59 pm on Mar 10, 2009 (gmt 0)

Ok, I'll do it.

anyway thanks for support.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved