|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
ISAPI RewriteI am trying to use ISAPI rewrite for some 301 redirects and can't figure out the Reg Ex for it. I need [article.php?id=10] to be 301 redirected to [index.cfm?event=IndustryNewsDetail&IndustryNewsID=24] and [article.php?id=11] to be 301 redirected to index.cfm?event=IndustryNewsDetail&IndustryNewsID=25] but I can figure out how to get the article.php?id=10 to be found using ISAPI rewrite currently trying with no luck RewriteRule /article.php(\?)?(id=10) /index.cfm?event=IndustryNewsDetail&IndustryNewsID=24 [I,O,RP,L] RewriteRule /article.php(\?)?(id=11) /index.cfm?event=IndustryNewsDetail&IndustryNewsID=25 [I,O,RP,L] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328288 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
RE: ISAPI RewriteWhy have a rule for each article when you could use the same rule for all of them? Try this out: RewriteRule (.*)/article.php?id=([0-9]+) $1/index.cfm?event=IndustryNewsDetail&IndustryNewsID=$2 -----Original Message----- From: Chad McCue [mailto:Chad@...] Sent: Wednesday, November 11, 2009 9:07 PM To: cf-talk Subject: ISAPI Rewrite I am trying to use ISAPI rewrite for some 301 redirects and can't figure out the Reg Ex for it. I need [article.php?id=10] to be 301 redirected to [index.cfm?event=IndustryNewsDetail&IndustryNewsID=24] and [article.php?id=11] to be 301 redirected to index.cfm?event=IndustryNewsDetail&IndustryNewsID=25] but I can figure out how to get the article.php?id=10 to be found using ISAPI rewrite currently trying with no luck RewriteRule /article.php(\?)?(id=10) /index.cfm?event=IndustryNewsDetail&IndustryNewsID=24 [I,O,RP,L] RewriteRule /article.php(\?)?(id=11) /index.cfm?event=IndustryNewsDetail&IndustryNewsID=25 [I,O,RP,L] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328289 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
Re: ISAPI Rewrite>Why have a rule for each article when you could use the same rule for all of >them? Because the ids do not correlate. >but I can figure out how to get the article.php?id=10 to be found using ISAPI rewrite I think you're close - the period and question marks are special regex characters that need escaping, and the parenthesis are redundant. Try: RewriteRule /article\.php\?id=10 /index.cfm?event=IndustryNewsDetail&IndustryNewsID=24 [I,O,RP,L] RewriteRule /article\.php\?id=11 /index.cfm?event=IndustryNewsDetail&IndustryNewsID=25 [I,O,RP,L] Here's a really useful regex tester: http://gskinner.com/RegExr/ Dominic 2009/11/12 lists <lists@...> > > Why have a rule for each article when you could use the same rule for all > of > them? > > Try this out: > > RewriteRule (.*)/article.php?id=([0-9]+) > $1/index.cfm?event=IndustryNewsDetail&IndustryNewsID=$2 > > > -----Original Message----- > From: Chad McCue [mailto:Chad@...] > Sent: Wednesday, November 11, 2009 9:07 PM > To: cf-talk > Subject: ISAPI Rewrite > > > I am trying to use ISAPI rewrite for some 301 redirects and can't figure > out > the Reg Ex for it. > > I need [article.php?id=10] to be 301 redirected to > [index.cfm?event=IndustryNewsDetail&IndustryNewsID=24] > > and > > [article.php?id=11] to be 301 redirected to > index.cfm?event=IndustryNewsDetail&IndustryNewsID=25] > > but I can figure out how to get the article.php?id=10 to be found using > ISAPI rewrite > > currently trying with no luck > RewriteRule /article.php(\?)?(id=10) > /index.cfm?event=IndustryNewsDetail&IndustryNewsID=24 [I,O,RP,L] > > RewriteRule /article.php(\?)?(id=11) > /index.cfm?event=IndustryNewsDetail&IndustryNewsID=25 [I,O,RP,L] > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328296 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
RE: ISAPI RewriteAh. I assumed that was just part of your example. In the ISAPI Rewrite rule I wrote for a client I did not need to escape the ? Or period when used like I wrote. andy -----Original Message----- From: Dominic Watson [mailto:watson.dominic@...] Sent: Thursday, November 12, 2009 4:51 AM To: cf-talk Subject: Re: ISAPI Rewrite >Why have a rule for each article when you could use the same rule for >all of >them? Because the ids do not correlate. >but I can figure out how to get the article.php?id=10 to be found using ISAPI rewrite I think you're close - the period and question marks are special regex characters that need escaping, and the parenthesis are redundant. Try: RewriteRule /article\.php\?id=10 /index.cfm?event=IndustryNewsDetail&IndustryNewsID=24 [I,O,RP,L] RewriteRule /article\.php\?id=11 /index.cfm?event=IndustryNewsDetail&IndustryNewsID=25 [I,O,RP,L] Here's a really useful regex tester: http://gskinner.com/RegExr/ Dominic 2009/11/12 lists <lists@...> > > Why have a rule for each article when you could use the same rule for > all of them? > > Try this out: > > RewriteRule (.*)/article.php?id=([0-9]+) > $1/index.cfm?event=IndustryNewsDetail&IndustryNewsID=$2 > > > -----Original Message----- > From: Chad McCue [mailto:Chad@...] > Sent: Wednesday, November 11, 2009 9:07 PM > To: cf-talk > Subject: ISAPI Rewrite > > > I am trying to use ISAPI rewrite for some 301 redirects and can't > figure out the Reg Ex for it. > > I need [article.php?id=10] to be 301 redirected to > [index.cfm?event=IndustryNewsDetail&IndustryNewsID=24] > > and > > [article.php?id=11] to be 301 redirected to > index.cfm?event=IndustryNewsDetail&IndustryNewsID=25] > > but I can figure out how to get the article.php?id=10 to be found > using ISAPI rewrite > > currently trying with no luck > RewriteRule /article.php(\?)?(id=10) > /index.cfm?event=IndustryNewsDetail&IndustryNewsID=24 [I,O,RP,L] > > RewriteRule /article.php(\?)?(id=11) > /index.cfm?event=IndustryNewsDetail&IndustryNewsID=25 [I,O,RP,L] > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328297 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
| Free embeddable forum powered by Nabble | Forum Help |