Forum Moderators: phranque

Message Too Old, No Replies

301 no longer works?

         

wheelie34

8:52 am on Sep 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi

For the last year and a bit this code has worked perfectly

RewriteEngine on
# redirect non-www to www subdomain.
RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteRule (.*) [domain.com...] [R=301,L]

My host had issues 3 days ago and now it wont work at all?

I have noticed, prior to the "issues" they had during ftp you could not see the .htaccess file (I understand why) but now I can.

After much reading here I still cant get it to work, I have tried adding Options +FollowSymLinks that doesnt help either.

Help anyone?

Added: the above code works perfect on one of my other servers?

zCat

8:58 am on Sep 29, 2006 (gmt 0)

10+ Year Member



Sound like your host has screwed up their Apache configuration and it no longer recognizes .htaccess files (or they're switched off the mod_rewrite module or something).

wheelie34

9:09 am on Sep 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi zCat

I have other rules in the .htaccess that still work, such as

^folder$ [domain...] [R=301,L]

and I tell it to run php on some html pages, all which still work fine its just the non to www that stopped

jdMorgan

7:03 pm on Sep 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your host has misconfigured your server, somehow. Your code looks good, and as you say, it works in another server. I'd suggest you take this up with them.

Jim

wheelie34

3:34 pm on Oct 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Jim

mmmm I just got a reply from the host they say it works in firefox, and it does! but not in ie6 any ideas

If you want to see for yourself pm me and I will give you the URL

[edited by: jdMorgan at 3:43 pm (utc) on Oct. 2, 2006]
[edit reason] Minor edit for TOS #3 [/edit]

jdMorgan

3:41 pm on Oct 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you flushed your IE Temporary Internet files in Internet Options? You could just be seeing a cached copy of the un-redirected page.

If that doesn't help, I'd suggest logging into Windows under a different administrator account, and deleting the file
C:\Documents and Settings\<user-name>\Local Settings\Temporary Internet Files\Content.IE5\index.dat

This file will not be visible if you are still logged-in with your usual account. You will also have to set Windows to "Show hidden files" to see it. IE will re-create this file when you next start it. This file often
gets bloated, leading to system slow-downs, or corrupted, leading to 'strange' problems in IE.

Jim

wheelie34

4:10 pm on Oct 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Jim

Thanks for your help, it was not the .dat file, my host has stated I need a @ A record in my DNS so I have just set that up and now its fine.

Whats a @ A record for anyway?

jdMorgan

4:47 pm on Oct 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's a shorthand notation used by some DNS control panel applications -- None of which I've used.

Is it the case that your www subdomain was not previously-defined in your DNS Zone file? That's the only thing I can think of, and I haven't yet figured out why there would be a difference between IE and Firefox in the handling of such a situation. You might try testing again, and make note of what domain+URL you type, and what domain+URL the browsers actually try to fetch. That might be revealing.

Jim