Forum Moderators: phranque
Old:
http://www.domain1.com/webapp/wcs/stores/servlet/ProductDisplay?productId=246323&storeId=30003&langId=-1&catalogId=10001
New:
http://www.domain2.com/webapp/wcs/stores/servlet/ProductDisplay?productId=246323&storeId=30003&langId=-1&catalogId=10001
I tried...
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
RewriteCond %{QUERY_STRING} ^(.*)productId=([0-9]+)&(.*)$ [NC]
RewriteCond %{HTTP_REFERER} ^domain1.com$ [NC]
RewriteRule ^(.*)$ http://www.domain2.com
RewriteCond %{HTTP_HOST} ^(.*)www.domain1.com$ [NC]
RewriteRule ^(.*)$ http://www.domain2.com$1?%{QUERY_STRING} [R=301,L]
================================================================================================
RewriteRule ^(.*)ProductDisplay(.*) http://www.domain2.com$1/ProductDisplay/$2 [R=301,L]
================================================================================================
RewriteCond %{HTTP_HOST} ^www.domain1.com$ [NC]
RewriteRule (.*) http://www.domain2.com/$1 [R=301,L]
=================================================================================================
I would really appreciate your help in this regard.
Thanks,
Tiru
[edited by: jdMorgan at 1:26 am (utc) on Aug. 2, 2007]
[edit reason] De-linked [/edit]
RewriteEngine on
RewriteRule (.*) http://www.domain2.com/$1 [R=301,L]
RewriteEngine on
RewriteCond %{HTTP_HOST} domain1\.com [NC]
RewriteRule (.*) http://www.domain2.com/$1 [R=301,L]
Jim
[edited by: jdMorgan at 1:27 am (utc) on Aug. 2, 2007]
We made DNS change to take care of this..those are working fine with domain1.com but failing when user tries with www.domain1.com.
The decommissioned site's content is still there on the server, before taking that off we want to make sure every thing working fine. But when we are trying to redirect with the above specified URL, its taking to the OLD content instead of redirecting this. Any thought on this. I would like to inform that we are set with AllowOveride NONE.Any other thoughts...
Thanks,
Tirumala
Then your DNS is not correct for www.domain1.com, and/or the server does not deliver requests for www.domain1.com to the same directory as requests for doamin1.com.
Neither of the rules posted above cares whether there is a "www." prefix on the requested hostname, so the problem is in the DNS or server configuration.
Jim
<VirtualHost 61.52.145.103:80>
ServerName www.domain1.com
DocumentRoot D:\Web\html\domain1\en_US
ErrorDocument 404 /404.html
#Redirect 301 / http://www.domain2.com/
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain1\.com [NC]
RewriteRule (.*) http://www.domain2.com [L,R=301]
</VirtualHost>
[edited by: jdMorgan at 1:28 am (utc) on Aug. 2, 2007]
[edit reason] De-linked [/edit]
Also, if this is for use in http.conf, then all you may need is the single line:
RewriteRule (.*) http://www.domain2.com$1 [R=301,L]
Jim
My trace log is showing... why its taking HTTP 200 i am not able to understand..
[06/Aug/2007:11:11:27 -0700] "GET /favicon.ico HTTP/1.1" 200 894
[06/Aug/2007:11:11:27 -0700] "GET /scripts/dom-drag.js HTTP/1.1" 200 3982
[06/Aug/2007:11:11:27 -0700] "GET /webapp/wcs/stores/servlet/ProductDisplay?productId=246324&storeId=30003&langId=-1&catalogId=10001 HTTP/1.1" 200 19777
[06/Aug/2007:11:11:27 -0700] "GET /scripts/dom-popup.js HTTP/1.1" 200 2398
[06/Aug/2007:11:11:28 -0700] "GET /images/header_02.jpg HTTP/1.1" 404 30284
[06/Aug/2007:11:11:28 -0700] "GET /images/header_01.jpg HTTP/1.1" 404 30284
[06/Aug/2007:11:11:28 -0700] "GET /images/header_04.gif HTTP/1.1" 404 30284
[06/Aug/2007:11:11:28 -0700] "GET /scripts/help_windows.js HTTP/1.1" 200 4777
[06/Aug/2007:11:11:28 -0700] "GET /images/header_03.jpg HTTP/1.1" 404 30284
[06/Aug/2007:11:11:28 -0700] "GET /images/leftnav_10.gif HTTP/1.1" 404 30284
[06/Aug/2007:11:11:28 -0700] "GET /images/header_06.gif HTTP/1.1" 404 16384
[06/Aug/2007:11:11:28 -0700] "GET /scripts/product_item_body.js HTTP/1.1" 200 1127
[06/Aug/2007:11:11:28 -0700] "GET /images/go.gif HTTP/1.1" 200 142
[06/Aug/2007:11:11:28 -0700] "GET /images/spacer.gif HTTP/1.1" 200 43
[06/Aug/2007:11:11:28 -0700] "GET /scripts/common_validations.js HTTP/1.1" 200 1658
[06/Aug/2007:11:11:28 -0700] "GET /images/leftnav_04.gif HTTP/1.1" 404 30284
[06/Aug/2007:11:11:28 -0700] "GET /scripts/product_scripts.js HTTP/1.1" 200 9921
[06/Aug/2007:11:11:28 -0700] "GET /images/leftnav_02.gif HTTP/1.1" 200 430
[06/Aug/2007:11:11:28 -0700] "GET /images/leftnav_06.gif HTTP/1.1" 404 16384
[06/Aug/2007:11:11:28 -0700] "GET /images/full/7665524.jpg HTTP/1.1" 200 31693
[06/Aug/2007:11:11:28 -0700] "GET /images/leftnav_08.gif HTTP/1.1" 404 30284
[06/Aug/2007:11:11:28 -0700] "GET /images/emailtofriend.gif HTTP/1.1" 200 467
[06/Aug/2007:11:11:28 -0700] "GET /images/ecatalog_linkback.gif HTTP/1.1" 200 796
[edited by: Tiru at 6:20 pm (utc) on Aug. 6, 2007]