Correct me in INI file

Topics: Developer Forum, Project Management Forum
Aug 18, 2009 at 1:56 PM

Am new to the Url rewrite and when i found your excellent tool. Great wrok !!

I have some hick-ups in my INI and frankly am new to regular expression too. Can u please correct me the Rules which won't work properly

I don't know why they are not working. Can you please correct me in this regard.

Thanks in advance

StatusUrl /iirfStatus

RewriteLogLevel 3

The below rules are working

-------------------------------------

RewriteRule  ^^/bogopublish/venturacounty/([^\.\/]+)/([^\.\/]+)/(.*)$ /bogopublish/$3_Tolp.aspx?pid=VEN001 [L]
RewriteRule  ^^/bogopublish/portland/([^\.\/]+)/([^\.\/]+)/(.*)$ /bogopublish/$3_Tolp.aspx?pid=PO001 [L]
RewriteRule  ^^/bogopublish/laweekly/([^\.\/]+)/([^\.\/]+)/(.*)$ /bogopublish/$3_Tolp.aspx?pid=LACA01 [L]

RewriteRule  ^/bogopublish/venturacounty$ /bogopublish/home.aspx?pid=VEN001 [L]
RewriteRule  ^/bogopublish/portland /bogopublish/home.aspx?pid=PO001 [L]
RewriteRule  ^/bogopublish/laweekly /bogopublish/home.aspx?pid=LACA01 [L]

The below rules are not working

-------------------------------------

RewriteRule  ^^/bogopublish/venturacounty/(*)$ /bogopublish/$1_Tolp.aspx?pid=VEN001 [L]
RewriteRule  ^^/bogopublish/portland/(*)$ /bogopublish/$1_Tolp.aspx?pid=PO001 [L]
RewriteRule  ^^/bogopublish/laweekly/(*)$ /bogopublish/$1_Tolp.aspx?pid=LACA01 [L]

RewriteRule  ^/bogopublish/Venturacounty/eatanddrink$ /bogopublish/col.aspx?id=0&pid=VEN001 [L]
RewriteRule  ^/bogopublish/Venturacounty/shopping$ /bogopublish/col.aspx?id=2&pid=VEN001 [L]

RewriteRule  ^/bogopublish/portland/eatanddrink /bogopublish/col.aspx?id=0&pid=PO001 [L]
RewriteRule  ^/bogopublish/portland/shopping /bogopublish/col.aspx?id=2&pid=PO001 [L]

RewriteRule  ^^/bogopublish/([^\.\/]+)\.aspx\?(.*)$ - [L]

 

Coordinator
Aug 18, 2009 at 4:25 PM

I'm sorry your rules are not working.

Just looking quickly, I see rules with two successive ^ characters.  I don't think you want that.

Also I don't know what you mean by "not working".  Each rule is generally intended to do something for a particular set of incoming URLs.  You'll have to explain what you expect from each rule, what you observe from the behavior of each rule, and then how those things are different. 

 

Aug 19, 2009 at 1:19 PM

Thanks for your response..

I will explain my application folder architechute first

1)  Am havinge this http://www.xxx.com/Home.aspx link which will have images and based on the PodId that will change. I have three podnames   venturacounty,portland and laweekly. I want to change the Url from the current one to like this http://www.xxx.com/venturacounty , http://www.xxx.com/portland like that.

2) Am having another link http://www.xxx.com/p6_Tolp.aspx, and these pages are merchant pages and each one have different address. So now i want to change this URL to like this http://www.xxx.com/venturacounty/thousand oaks/shopping/p6

This is the requirement in front of me. Can u please suggest/help me how to achive this?

Thanks in advance

-venkat

Coordinator
Aug 19, 2009 at 4:09 PM

I suggest that you read up on regex.  In the documentation there are lots of examples on how to use regex in IIRF.   If you read these examples and follow them carefully, you'll know not to use two carets ^^ in your regex, as I have seen in your examples of "expressions that do not work".  You will also know to avoid the use of (*) in your regex, which also occurs in your examples of things that don't work.   Also there is a nice tool in the IIRF download called TestDriver.exe which lets you test your regex and rules against URLs.  I think the tool is indispensable when creating a rule set. Really really useful for figuring these things out.

You have listed 14 rules above. Some of them work.  Some of them, you say, "don't work."   Of those that don't work, there are some obvious things that are invalid in a regular expression.  Things like doubled circumflex "^^"  , or a sequence like this (*).    The examples that are explained in great detail in the documentation page I Referenced, will clarify these things for you.  Also if you run the testdriver you will immediately see the problems - which expressions need fixing.

Some of the rules that "don't work" are not obviously wrong.  I'm sure you have a good idea as to what you mean by "they don't work".  Here again, the testdriver tool will be very helpful.  You can run URLs through a set of valid rules, and see the outputs.  If the output does not match your expectation, you can modify the rules. 

Good luck!  Start with the documentation.