Forum Moderators: phranque

Message Too Old, No Replies

Canonical URL problem

But RewriteEngine doesn't work

         

helleborine

4:12 pm on May 20, 2005 (gmt 0)

10+ Year Member



Hi,

Dayo_UK tells me that my sudden drop in SERPs might be due to a Canonical url problem.

http://www.mysite.example.com/ has a PR2

While

http://mysite.example.com/ has a PR4

I have a working .htaccess file, but attempts to include a RewriteEngine command do not work. The same command works on my other websites. I can have "deny from" commands, and custom error pages.

Is there any way I can fixed the canonical URL problem?

[edited by: jdMorgan at 9:36 pm (utc) on May 20, 2005]
[edit reason] example.com [/edit]

jdMorgan

7:30 pm on May 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> attempts to include a RewriteEngine command do not work.

Please define "do not work."

What is in your server error log when "it doesn't work"?

Jim

helleborine

7:48 pm on May 20, 2005 (gmt 0)

10+ Year Member



error 500 - is all I know.

I don't get error logs from that host. I do from all my other hosts...

jdMorgan

7:55 pm on May 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you added

Options +FollowSymLinks

to the .htaccess file before trying to enable the RewriteEngine?

Jim

helleborine

8:01 pm on May 20, 2005 (gmt 0)

10+ Year Member



So that it might look like this?

order allow,deny
Allow from all

deny from 12.345.67.89

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^example\.com
rewriterule (.*) http://www.example.com/$1 [R=301,L]

Allow from all
order allow,deny
allow from all

[edited by: jdMorgan at 9:37 pm (utc) on May 20, 2005]
[edit reason] example.com [/edit]

jdMorgan

8:42 pm on May 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Which domain do you want to keep?

Jim

helleborine

9:07 pm on May 20, 2005 (gmt 0)

10+ Year Member



I want to keep:
http://mysubdomain.example.com/

[edited by: jdMorgan at 9:37 pm (utc) on May 20, 2005]
[edit reason] example.com [/edit]

jdMorgan

9:34 pm on May 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




Options +FollowSymLinks
RewriteEngine on
# If NOT mysubdomain.example.com
RewriteCond %{HTTP_HOST} !^mysubdomain\.example\.com
# Redirect to mysubdomain.example.com
RewriteRule (.*) http://mysubdomain.example.com/$1 [R=301,L]

Jim

helleborine

9:54 pm on May 20, 2005 (gmt 0)

10+ Year Member



Mmmm... still error 500...

jdMorgan

10:09 pm on May 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It looks like you're not allowed to use mod_rewrite.

Without an error log, there's nothing I can recommend except to change hosts.

Jim

helleborine

1:40 am on May 21, 2005 (gmt 0)

10+ Year Member



All is not lost...

I'm using the command on all my other websites... where it does work.

Thanks!