Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Should be easy Rewrite Rule not working Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
MountinYew
Newbie
Newbie


Joined: 07 June 2007
Location: United States
Online Status: Offline
Posts: 12
Posted: 23 July 2010 at 5:28pm | IP Logged Quote MountinYew

I want to rewrite requests for:

/site_geo_template.cfm?cityname=new
york&keywordphrase=some keyword

to:

/services_new_york_some_keyword.html

Here's the rule i'm trying in the RegexTest:

RewriteRule ^services_(.*)_(.*)\.html
site_geo_template.cfm?cityname=$1&keywordphrase=$2 [NC]

It keeps giving "pattern not matched errors"

I'm sure it's something simple like a missing "\", "$",
etc., but i've tried every think i can think of and it
won't work.

Can someone help please?

Thanks


Edited by MountinYew - 23 July 2010 at 5:29pm


__________________
Dan Slater
Back to Top View MountinYew's Profile Search for other posts by MountinYew Visit MountinYew's Homepage
 
AndrushkaUS
Admin Group
Admin Group


Joined: 13 November 2009
Location: United States
Online Status: Offline
Posts: 3159
Posted: 26 July 2010 at 5:25am | IP Logged Quote AndrushkaUS

Hello Dan,

The rule you're trying to apply is taking /services_new_york_some_keyword.html and cuts it according to the pattern.
So at the end it's transformed into:

Code:
site_geo_template.cfm?cityname=new&keywordphrase=york


So I would suggest a separator like 'dash' for citynames and keywords.
Code:
/services_new-york_some-keyword.html


Regards
Andrew

__________________
The will to conquer is the first condition of VICTORY
Back to Top View AndrushkaUS's Profile Search for other posts by AndrushkaUS
 
MountinYew
Newbie
Newbie


Joined: 07 June 2007
Location: United States
Online Status: Offline
Posts: 12
Posted: 26 July 2010 at 9:51am | IP Logged Quote MountinYew

so you're saying that the underscore currently in place in
my rule won't work, but a dash will?

I tried changing the _ to a - but it had no effect, the
rule is still not working...

Current rule:

RewriteRule ^services_(.*)-(.*)\.html
site_geo_template.cfm?cityname=$1&keywordphrase=$2 [NC]

__________________
Dan Slater
Back to Top View MountinYew's Profile Search for other posts by MountinYew Visit MountinYew's Homepage
 
AndrushkaUS
Admin Group
Admin Group


Joined: 13 November 2009
Location: United States
Online Status: Offline
Posts: 3159
Posted: 27 July 2010 at 4:56am | IP Logged Quote AndrushkaUS

No, Dan.
The rule was fine. What I meant, is that you mentioned:

Code:
I want to rewrite requests for:
/site_geo_template.cfm?cityname=new

york&keywordphrase=some keyword
to:

/services_new_york_some_keyword.html


you have '_' as a separator in /services_new_york_some_keyword.html
That mixes everything up. I suggest changing URL structure to /services_new-york_some-keyword.html.

Is that gonna work for you?

Regards
Andrew

__________________
The will to conquer is the first condition of VICTORY
Back to Top View AndrushkaUS's Profile Search for other posts by AndrushkaUS
 

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