Forum Moderators: phranque

Message Too Old, No Replies

Mod rewrite Help - Redirect Old Domain to New Domain

problem with current .htaccess code

         

angmi90

11:21 pm on Nov 9, 2007 (gmt 0)

10+ Year Member



A few weeks ago I totally transferred my old site to my new site. I moved all the folders over to the new server so they have the exact same file structure and everything. My old domain is www.old-domain.com and my new domain is www.example.com. I have a .htaccess that currently redirects hits from any old-domain.com/ requests to example.com requests. I want exact page redirects...example- old-domain.com/test.php redirects to example.com/test.php.

I also want to exclude two folders on my old-domain.com domain from redirecting... /administrator and /keyclub

I have a current functioning .htaccess as follows below


Options +FollowSymLinks
RewriteEngine on
# Exclude /information directory from redirect
RewriteCond %{REQUEST_URI} !^/administrator
RewriteCond %{REQUEST_URI} !^/keyclub
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

However, if you type in www.old-domain.com from a IE 6.0 or earlier browser, you get an error that says "The XML page cannot be displayed. Cannot view XML input using style sheet." The redirect works, however, in IE 7.0.

How do I fix this?

Thanks in advance.

[edited by: jdMorgan at 11:53 pm (utc) on Nov. 9, 2007]
[edit reason] examplified URLs per TOS. [/edit]

jdMorgan

11:57 pm on Nov 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check the Content-type response headers being sent by your new server. The symptoms indicate the problem is incorrect (and possibly undefined) MIME-types sent with pages from your new server.

The "Live HTTP Headers" add-on for Firefox and Mozilla-based browsers is a good tool for this kind of work. Alternatively, you can use an on-line server headers checker, but beware that some of them either don't display all headers, or omit intermediate redirects, or both.

The AddType directive is used to associate MIME-types (Content-types) with filetypes on Apache.

Jim

angmi90

12:26 am on Nov 10, 2007 (gmt 0)

10+ Year Member



This is what I got when I went to www.old-domain.com using the HTTP Live Headers....does anyone see a problem?

http://www.old-domain.com/

GET / HTTP/1.1
Host: www.old-domain.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: jcalpro1_hidden_display=recurrence; stalyticsCookie=recurrent_count_%23%3A%23_1;
HTTP/1.x 301 Moved Permanently
Date: Sat, 10 Nov 2007 00:25:05 GMT
Server: Apache
Location: http://www.example.com/
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1
----------------------------------------------------------
http://www.example.com/

GET / HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: __utmz=205304619.1190502384.119.14.utmccn=(referral)¦utmcsr=us.mg1.mail.yahoo.com¦utmcct=/dc/blank.html¦utmcmd=referral;

HTTP/1.x 200 OK
Date: Sat, 10 Nov 2007 00:25:06 GMT
Server: Apache
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Pragma: no-cache
Set-Cookie: 58416a8cdac7e461afac09036d684392=-; path=/
Set-Cookie: mosvisitor=1
Last-Modified: Sat, 10 Nov 2007 00:25:07 GMT
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html

[edited by: jdMorgan at 3:04 am (utc) on Nov. 10, 2007]
[edit reason] obscured URLs and other info [/edit]

jdMorgan

3:08 am on Nov 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't see anything wrong with the headers for that request sequence. :(

The only thing I could see is that your browser needs the latest security update, which has nothing to do with the problem you're reporting.

Jim