Isapi 3 Rewrite Multipage 301 Assistance

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 3
Joined: 18 Dec 2012, 00:31

Isapi 3 Rewrite Multipage 301 Assistance

18 Dec 2012, 00:49

I am trying to figure out the correct statements needed so I can do multiple page 301 redirect to pages that were originally in generated in an .asp program and are now being generated is .php program. I am on a shared server that has Isapi_Rewrite 3 running on it. The php software is currently using the Isapi_Rewrite 3 software to rewrite the urls it generates, so it seems to be working properly.

I have a .htaccess file in the root directory, but I can not get the pages to redirect as expected. I keep getting a 404 errors instead.

Here is a sample of what I want to do:

Old Link:

http://www.dev.mycompany.com/detail.aspx?ID=1812

New Link:
http://www.dev.mycompany.com/noland-eng ... ander.html


There will be multiple page redirects in basically the same type as the two above.

I've tried variations on the following:

RewriteEngine on
RewriteCond Host: dev\.mycompany\.com
RewriteRule ^SearchResult\.aspx\?CategoryID\=449$ /electronics/nmea-devices/nmea-0183-en-2/multiplexers-0183/ [NC,R=301,L]

,but with no success.

Any help with this would be appreciated.

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Isapi 3 Rewrite Multipage 301 Assistance

18 Dec 2012, 08:53

Hello,

The rule should be as follows:

RewriteBase /
RewriteCond %{HTTP_HOST} ^dev\.mycompany\.com$ [NC]
RewriteCond %{QUERY_STRING} ^CategoryID=449$ [NC]
RewriteRule ^SearchResult\.aspx$ /electronics/nmea-devices/nmea-0183-en-2/multiplexers-0183/? [NC,R=301,L]

User avatar
Posts: 3
Joined: 18 Dec 2012, 00:31

Re: Isapi 3 Rewrite Multipage 301 Assistance

18 Dec 2012, 23:31

Thank you for your quick answer Anton!

I uploaded the code to the server, but I just get a 404 error. So I guess I need to look further. Maybe something else on the server is not correct.

User avatar
Posts: 3
Joined: 18 Dec 2012, 00:31

Re: Isapi 3 Rewrite Multipage 301 Assistance

19 Dec 2012, 02:42

This is what is currently in .htaccess file: (does the order of the statements make a difference?)
**************

DirectoryIndex index.html index.php

<IfModule mod_rewrite.c>

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^dev\.mysite\.com$ [NC]
RewriteCond %{QUERY_STRING} ^CategoryID=449$ [NC]
RewriteRule ^SearchResult\.aspx$ /electronics/nmea-devices/nmea-0183-en-2/multiplexers-0183/? [NC,R=301,L]


# Please note that RewriteBase setting is obsolete use it only in case you experience some problems with SEO addon.
# Some hostings require RewriteBase to be uncommented
# Example:
# Your store url is http://www.yourcompany.com/store/cart
# So "RewriteBase" should be:
# RewriteBase /store/cart
# RewriteBase /



RewriteCond %{REQUEST_FILENAME} !\.(png|gif|ico|swf|jpe?g|js|css)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php?sef_rewrite=1 [L,QSA]




</IfModule>

***********

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Isapi 3 Rewrite Multipage 301 Assistance

19 Dec 2012, 07:35

Hello,

"does the order of the statements make a difference?"
- in your case it doesn't

As for the rule we are trying to make working, could you enable logging in httpd.conf by putting

RewriteLogLevel 9

then request the URL in question once again and provide the portion of rewrite.log corresponding to this request.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 58 guests