This forum has been moved here:
Helicon Tech Community Forum

Helicon Ape (Forum Locked Forum Locked)
 Helicon Tech : Helicon Ape
Subject Topic: Trying to upgrade to Ape from Rewrite3
Author
Message |
kwheat99
Newbie


Joined: 27 May 2010
Location: United States
Posts: 11
Posted: 02 July 2010 at 7:51am

Hi,

I'm trying to upgrade to Ape from Rewrite3 and our rules are not working. the rewrite.log contains these lines...

(1) [perdir c:\inetpub\abc\] init rewrite engine with /cincinnati-oh/relief-center/neck
 (5) [perdir c:\inetpub\abc\] strip matching prefix: /cincinnati-oh/relief-center/neck -> cincinnati-oh/relief-center/neck
 (3) [perdir c:\inetpub\abc\] applying pattern ^searchresults\.aspx$ to uri cincinnati-oh/relief-center/neck
 (5) [perdir c:\inetpub\abc\] strip matching prefix: /cincinnati-oh/relief-center/neck -> cincinnati-oh/relief-center/neck
 (3) [perdir c:\inetpub\abc\] applying pattern ^([^/]+)/relief-center/([^/]+)/?$ to uri cincinnati-oh/relief-center/neck
(4) [perdir c:\inetpub\abc\] RewriteCond: input='C:\inetpub\abc\cincinnati-oh\relief-center\neck' pattern='-d' => matched
(4) [perdir c:\inetpub\abc\] RewriteCond: input='C:\inetpub\abc\cincinnati-oh\relief-center\neck' pattern='-f' => matched
 (5) [perdir c:\inetpub\abc\] add per-dir prefix: searchresults.aspx?query=neck&s=1 -> /searchresults.aspx?query=neck&s=1
(1) [perdir c:\inetpub\abc\] Rewrite URL to >> /searchresults.aspx?query=neck&s=1 [REWRITE]
(1) [perdir c:\inetpub\abc\] Rewrite URL /cincinnati-oh/relief-center/neck to >> /searchresults.aspx [INTERNAL_REDIRECT]
 (5) [perdir c:\inetpub\abc\] strip matching prefix: /searchresults.aspx -> searchresults.aspx
(3) [perdir c:\inetpub\abc\] applying pattern ^searchresults\.aspx$ to uri searchresults.aspx
 (4) [perdir c:\inetpub\abc\] RewriteCond: input='query=neck&s=1' pattern='^query=([^&]+)&s=(.*)$' => matched
 (5) [perdir c:\inetpub\abc\] add per-dir prefix: cincinnati-oh/relief-center/neck? -> /cincinnati-oh/relief-center/neck?
(2) [perdir c:\inetpub\abc\] forcing responsecode 301 for http://www.abc.com/cincinnati-oh/relief-center/neck

and the rule is...
RewriteEngine On

RewriteBase /

RewriteMap mapSites txt:mapSites.txt [NC]
RewriteMap revmapSites txt:revmapSites.txt [NC]


# making a redirect for those who requested searchresults.aspx to a 'clean' URL
RewriteCond %{QUERY_STRING} ^query=([^&]+)&s=(.*)$ [NC]
RewriteRule ^searchresults\.aspx$ ${mapSites:%2}/relief-center/%1? [NC,NE,R=301,L]

# making a rewrite from 'clean' URL to searchresults.aspx
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/relief-center/([^/]+)/?$ searchresults.aspx?query=$2&s=${revmapSites:$1}

Any help would be much appreciated.
Best,
Kelton

Back to Top Visit kwheat99's Homepage
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 02 July 2010 at 11:24am

Hello,
Please try the following code:

Code:
RewriteEngine On

RewriteBase /

RewriteMap mapSites txt:mapSites.txt [NC]
RewriteMap revmapSites txt:revmapSites.txt [NC]


# making a redirect for those who requested searchresults.aspx to a 'clean' URL
RewriteCond %{QUERY_STRING} ^query=([^&]+)&s=(.*)$ [NC]
RewriteRule ^searchresults\.aspx$ ${mapSites:%2}/relief-center/%1? [NC,NE,R=301,L]

# making a rewrite from 'clean' URL to searchresults.aspx
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/relief-center/([^/]+)/?$ searchresults.aspx?query=$2&s=${revmapSites:$1} [NS,NC,L]


__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top Visit Vyacheslav's Homepage
 
kwheat99
Newbie


Joined: 27 May 2010
Location: United States
Posts: 11
Posted: 02 July 2010 at 11:54am

Thanks Slava. I tried this and it is still running in a loop. I must also tell you that I am running 2003/IIS6 with wildcard turned on. The rewrite.log becomes very large in a short amount of time.

Any additional help would be appreciated.
Thanks,
Kelton
Back to Top Visit kwheat99's Homepage
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version