Need Help to write rules....

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 24
Joined: 15 Feb 2013, 04:06

Need Help to write rules....

28 Jun 2013, 09:19

Hi,

I have to write some rules to redirect users from some URLs to other URL. Please refer below example --

Source Url: http://at.1234.com/Documents/1234%20Test%20for%20Consumer%20Packing%20Goods%20sales%20deck%202007%20version.pptx

Redirect URL: https://at.1234.com/KandA/TestLibrary/Ind%20Exp%20Utility

Please provide the redirection conditions and rules

Thanks & Regards,

Galisetti

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Need Help to write rules....

28 Jun 2013, 18:13

Hello,

Please, try using

Code: Select all
RewriteEngine on
RewriteBase /

RewriteCond %{HTTP:Host} ^at\.1234\.com$ [NC]
RewriteRule ^Documents/1234\%20Test\%20for\%20Consume\r%20Packing\%20Goods\%20sales\%20deck\%202007\%20version.pptx$ /KandA/TestLibrary/Ind%20Exp%20Utility [NC,R=301,L]


Regards
Andrew

User avatar
Posts: 24
Joined: 15 Feb 2013, 04:06

Re: Need Help to write rules....

01 Jul 2013, 10:01

Hi Andrew,

After entering Source Url: http://at.1234.com/Documents/1234%20Test%20for%20Consumer%20Packing%20Goods%20sales%20deck%202007%20version.pptx
browser window is closed, and download popup window is opened. Its not redirect to https://at.1234.com/KandA/TestLibrary/Ind%20Exp%20Utility.

Please provide the solution

Thanks & Regards,
Galisetti
Last edited by Galisetti on 01 Jul 2013, 10:20, edited 1 time in total.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Need Help to write rules....

01 Jul 2013, 10:08

Is it opening the right file in this download window?

User avatar
Posts: 24
Joined: 15 Feb 2013, 04:06

Re: Need Help to write rules....

01 Jul 2013, 10:21

yes, its opening right file..

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Need Help to write rules....

01 Jul 2013, 14:27

In this case ISAPI_Rewrite did everything it was supposed to do. It just redirected, the fact that the download windows gets opened means there are some IIS settings that need to be changed. I think it's something about MIME type.

Regards
Andrew

User avatar
Posts: 24
Joined: 15 Feb 2013, 04:06

Re: Need Help to write rules....

04 Jul 2013, 04:20

Hi Andrew,

can you provide the steps to check MIME Type settings in IIS which you have mention in the post.


Thanks & Regards,

Galisetti

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Need Help to write rules....

04 Jul 2013, 10:29

Hello,

I re-read the whole topic and take my words back about the MIME type. Lets simply take a look at the rewrite.log and see how the request is processed. Logging issues are described in FAQ - http://www.helicontech.com/forum/10648-FAQ.html

Regards
Andrew

User avatar
Posts: 4
Joined: 11 Jul 2013, 01:08

Re: Need Help to write rules....

11 Jul 2013, 01:18


User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Need Help to write rules....

11 Jul 2013, 11:10

Hello,

Please, try:

Code: Select all
RewriteCond %{HTTP:Host} ^mazda\.com\.my$ [NC]
RewriteRule ^mailman/admindb/allmazda_mazda\.com\.my$ http://herod.dnsvine.com/mailman/admindb/allmazda_mazda.com.my [NC,R=301,L]


Or do you rather want more universal rule?

Regards
Andrew

User avatar
Posts: 4
Joined: 11 Jul 2013, 01:08

Re: Need Help to write rules....

15 Jul 2013, 00:23

Thank You Andrew for your help.

I have put the rule to ISAPI_rewrite config file. But as you see its doesn't work.

Did i put the rule in wrong place? Where should i put the rule?

User avatar
Posts: 4
Joined: 11 Jul 2013, 01:08

Re: Need Help to write rules....

15 Jul 2013, 00:26

Thanks Andrew for your awesome help.

I want only this specific url to be redirected.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Need Help to write rules....

15 Jul 2013, 08:44

1) In this case make sure ISAPI_Rewrite is working at all by following FAQ - http://www.helicontech.com/forum/10648-FAQ.html

2) You also need to have these lines on top of your config:

RewriteEngine on
RewriteBase /


3) The rule should be in .htaccess or httpd.conf.

Regards
Andrew

User avatar
Posts: 4
Joined: 11 Jul 2013, 01:08

Re: Need Help to write rules....

16 Jul 2013, 01:47

Hello Andrew,

Thank you your help. I will do that.

User avatar
Posts: 24
Joined: 15 Feb 2013, 04:06

Re: Need Help to write rules....

18 Jul 2013, 04:32

Hi,

my rule is:

RewriteCond %{HTTP:Host} ^at\.1234\.com$ [NC]
RewriteRule ^try/1234/ABC\ Library/Credentials\ and\ Experience/1234\ Experience\ Industrial\ abc\.pptx$ /capital/GLibrary/15af43f7\%2D1625\%2D4381\%2D885c\%2D55299c087bae [NC,R=301,L,NE]

i am missing "?" in end of line my i know what is the impact of "?".

RewriteCond %{HTTP:Host} ^at\.1234\.com$ [NC]
RewriteRule ^try/1234/ABC\ Library/Credentials\ and\ Experience/1234\ Experience\ Industrial\ abc\.pptx$ /capital/GLibrary/15af43f7\%2D1625\%2D4381\%2D885c\%2D55299c087bae? [NC,R=301,L,NE]

Regards,
Ramesh

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Need Help to write rules....

18 Jul 2013, 10:34

Hello,

The '?' at the end of the rule prevents appending the querystring from original request.

Regards
Andrew

User avatar
Posts: 24
Joined: 15 Feb 2013, 04:06

Re: Need Help to write rules....

19 Jul 2013, 02:50

Hi,

In our production server already having 2000 query string rules, i am appending 23 rules below type

Source Url: https://at.1234.com/try/1234/ABC Library/Credentials and Experience/1234 Experience Industrial abc.pptx

Redirect Url: https://at.1234.com/capital/GLibrary/15 ... 299c087bae

Rule is -

RewriteCond %{HTTP:Host} ^at\.1234\.com$ [NC]
RewriteRule ^try/1234/ABC\ Library/Credentials\ and\ Experience/1234\ Experience\ Industrial\ abc\.pptx$ /capital/GLibrary/15af43f7\%2D1625\%2D4381\%2D885c\%2D55299c087bae [NC,R=301,L,NE]

then after i am getting web page cannot find(it looked like the user was getting redirected over and over in an infinite loop).

Missing '?' is the reason i am getting below error
web page cannot find(it looked like the user was getting redirected over and over in an infinite loop)


any help you could give would be appricated.

Thanks & Regards,
Galisetti

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Need Help to write rules....

19 Jul 2013, 12:37

The rule is okay. It's hard to say why it is happening without seeing the whole picture(other rules) and the logs. Logging issues are described in FAQ - http://www.helicontech.com/forum/10648-FAQ.html

Rewrite.log shows the processing of the request.

Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 9 guests