Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: Problems with Redirect 302 - 301 Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Brad C
Newbie
Newbie


Joined: 16 September 2008
Location: United States
Online Status: Offline
Posts: 4
Posted: 16 September 2008 at 3:49pm | IP Logged Quote Brad C

Greetings... I was recommened your product for our IIS environment to redirect users to our site (MOSS 2007) We are having problems getting the code to successfully work.

Here is what we want to do...

URL: http://www.abc.com
Sends the user via a 301 to http://www.abc.com/en-us/pages.home.aspx/

The thing with MOSS is that by default the redirect is a 302, we want this to explicticly be a 301.

Right now we're seeing to many hops as it's going from

1. REQUESTING: http://www.abc.com
HEAD / HTTP/1.1
Connection: Keep-Alive
HOST: www.abc.com
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)
Accept: */*
   SERVER RESPONSE: 302 Object Moved
Content-Length: 170
Content-Type: text/html
Location: http://www.abc.com/Pages/VariationRoot.aspx
Server: Microsoft-IIS/6.0
MicrosoftSharePointTeamServices: 12.0.0.6219
Date: Tue, 16 Sep 2008 20:22:42 GMT
Redirecting to http://www.abc.com/Pages/VariationRoot.aspx ...

2. REQUESTING: http://www.abc.com/Pages/VariationRoot.aspx
HEAD /Pages/VariationRoot.aspx HTTP/1.1
Connection: Keep-Alive
HOST: www.abc.com
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)
Accept: */*
   SERVER RESPONSE: 302 Found
Date: Tue, 16 Sep 2008 20:22:42 GMT
Server: Microsoft-IIS/6.0
MicrosoftSharePointTeamServices: 12.0.0.6219
X-AspNet-Version: 2.0.50727
Location: http://www.abc.com/en-US
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 145
Redirecting to http://www.abc.com/en-US ...

3. REQUESTING: http://www.abc.com/en-US
HEAD /en-US HTTP/1.1
Connection: Keep-Alive
HOST: www.abc.com
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)
Accept: */*
   SERVER RESPONSE: 302 Found
Date: Tue, 16 Sep 2008 20:22:42 GMT
Server: Microsoft-IIS/6.0
MicrosoftSharePointTeamServices: 12.0.0.6219
Location: http://www.abc.com/en-US/
Content-Length: 215
Content-type: text/html
Redirecting to http://www.abc.com/en-US/ ...

4. REQUESTING: http://www.abc.com/en-US/
HEAD /en-US/ HTTP/1.1
Connection: Keep-Alive
HOST: www.abc.com
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)
Accept: */*
   SERVER RESPONSE: 302 Object Moved
Content-Length: 167
Content-Type: text/html
Location: http://www.abc.com/en-US/Pages/Home.aspx
Server: Microsoft-IIS/6.0
MicrosoftSharePointTeamServices: 12.0.0.6219
Date: Tue, 16 Sep 2008 20:22:42 GMT
Redirecting to http://www.abc.com/en-US/Pages/Home.aspx ...

5. REQUESTING: http://www.abc.com/en-US/Pages/Home.aspx
HEAD /en-US/Pages/Home.aspx HTTP/1.1
Connection: Keep-Alive
HOST: www.abc.com
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)
Accept: */*
   SERVER RESPONSE: 200 OK
Date: Tue, 16 Sep 2008 20:22:42 GMT
Server: Microsoft-IIS/6.0
MicrosoftSharePointTeamServices: 12.0.0.6219
X-AspNet-Version: 2.0.50727
Cache-Control: private
Expires: Tue, 16 Sep 2008 20:32:28 GMT
Vary: *
Content-Type: text/html; charset=utf-8
Content-Length: 38916
Maximum number of redirects occured.

Destination URI: http://www.abc.com/en-US/Pages/Home.aspx


We just want the rewrite to go from http://www.abc.com to http://www.abc.com/en-us/pages/home.aspx.

Here is the last example of the code we had been working with before the end of the day:

# Pages Redirect - Change 302 to 301 redirect
RewriteCond  %{HTTP:Host} VariationRoot.aspx$
RewriteRule / http\://www.abc.com/en-US/Pages/Home.aspx [I,RP]

Guidance would be appreciated.

 

Back to Top View Brad C's Profile Search for other posts by Brad C
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Online
Posts: 4842
Posted: 17 September 2008 at 1:59am | IP Logged Quote Anton

As far as I understand you are using v2.
Then the rules should look like:

RewriteCond %{HTTP:Host} www\.abc\.com
RewriteRule / http\://www.abc.com/en-US/Pages/Home.aspx [I,RP]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
Brad C
Newbie
Newbie


Joined: 16 September 2008
Location: United States
Online Status: Offline
Posts: 4
Posted: 17 September 2008 at 8:46am | IP Logged Quote Brad C

Hi Anton,

I'm using the latest version as i downloaded it yesterday.

Back to Top View Brad C's Profile Search for other posts by Brad C
 
Brad C
Newbie
Newbie


Joined: 16 September 2008
Location: United States
Online Status: Offline
Posts: 4
Posted: 17 September 2008 at 10:36am | IP Logged Quote Brad C

Also.... when i use that code.. it works to some extent but the css styles, images, and javascripts do not download.

Back to Top View Brad C's Profile Search for other posts by Brad C
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Online
Posts: 4842
Posted: 18 September 2008 at 1:46am | IP Logged Quote Anton

Guess, you are talking about latest version of ISAPI_Rewrite3 (not v2).
Then you code (in .htaccess file) should look like this:

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^$ /en-US/Pages/Home.aspx [NC,R=301,L]


__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
Brad C
Newbie
Newbie


Joined: 16 September 2008
Location: United States
Online Status: Offline
Posts: 4
Posted: 18 September 2008 at 1:52pm | IP Logged Quote Brad C

Ok.. i understand on putting the code into the .htaccess file.. but what other code do i still need? What needs to go into the .conf?

Back to Top View Brad C's Profile Search for other posts by Brad C
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Online
Posts: 4842
Posted: 19 September 2008 at 3:05am | IP Logged Quote Anton

Your httpd.conf may be empty.

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You can vote in polls in this forum