Forum Moderators: phranque

Message Too Old, No Replies

htaccess redirects not working

it was working fine but not now

         

dmje

2:07 am on Aug 31, 2006 (gmt 0)

10+ Year Member



I have a strange problem I think, We have had the following line, along with others, in our htaccess file for quite sometime and it worked as far as I know up until today, but now for a reason I cannot determine it has stopped working

RewriteRule ^metal/jewelry.html$ [ourdomain.com...] [R=301,L]

Instead of redirecting the metal/jewelry.html to ourdomain it does one of two things depending on whether the www prefix is used or not.

If the www is used, as in, [ourdomain.com...] the header checker returns a 404 not found response.

SEO Consultants Directory Check Server Headers - Single URI Results
Current Date and Time: 2006-08-30T19:04:57-0700
User IP Address: 172.131.231.250
#1 Server Response: [ourdomain.com...]
HTTP Status Code: HTTP/1.1 404 Not Found
Date: Thu, 31 Aug 2006 02:04:41 GMT
Server: Apache/1.3.36 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.2 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.27 OpenSSL/0.9.7a
Connection: close
Content-Type: text/html

If the www is not used, [ourdomain.com...] I get the following response:

#1 Server Response: [ourdomain.com...]
HTTP Status Code: HTTP/1.1 301 Moved Permanently
Date: Thu, 31 Aug 2006 01:59:08 GMT
Server: Apache/1.3.36 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.2 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.27 OpenSSL/0.9.7a
Location: [ourdomain.com...]
Connection: close
Content-Type: text/html; charset=iso-8859-1
Redirect Target: [ourdomain.com...]
#2 Server Response: [ourdomain.com...]
HTTP Status Code: HTTP/1.1 200 OK
Date: Thu, 31 Aug 2006 01:59:08 GMT
Server: Apache/1.3.36 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.2 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.27 OpenSSL/0.9.7a
Connection: close
Content-Type: text/html
X-Pad: avoid browser bug

The very last lines of our htaccess file redirect the non www to the www, they are:

RewriteCond %{HTTP_HOST} ^ourdomain\.com [NC]
RewriteRule (.*) [ourdomain.com...] [R=301,L]

I get the correct response when checking the non www with a header checker, it shows moved perm and shows the redirect to the www version:

#1 Server Response: [ourdomain.com...]
HTTP Status Code: HTTP/1.1 301 Moved Permanently
Date: Thu, 31 Aug 2006 02:01:50 GMT
Server: Apache/1.3.36 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.2 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.27 OpenSSL/0.9.7a
Location: [ourdomain.com...]
Connection: close
Content-Type: text/html; charset=iso-8859-1
Redirect Target: [ourdomain.com...]
#2 Server Response: [ourdomain.com...]
HTTP Status Code: HTTP/1.1 200 OK
ETag: "3080b9-89fb-44f1b9eb"
Content-Length: 35323
Content-Type: text/html
Last-Modified: Sun, 27 Aug 2006 15:27:39 GMT

Can someone please advise why this is happening and what I can do to correct it?

jdMorgan

2:21 am on Aug 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I see nothing fatally wrong with that.

What else in your server configuration changed today? Look there.

Jim

dmje

2:26 am on Aug 31, 2006 (gmt 0)

10+ Year Member



Thanks for the response Jim,

Nothing has changed as far as I can tell.

I have another domain on the same server that has the same redirect and it works just fine.

You said you see nothing fatally wrong with what I had written, does that mean that something is wrong with it basically?

I'm stumped.

jdMorgan

2:55 am on Aug 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just a minor problem that at worst causes an ambiguity. The literal period in the pattern should be escaped:

RewriteRule ^metal/jewelr[b]y\.h[/b]tml$ http://www.example.com/ [R=301,L]

I would not expect that to have anything to do with your problem.

Jim