This forum has been moved here:
Helicon Tech Community Forum

Helicon Ape (Forum Locked Forum Locked)
 Helicon Tech : Helicon Ape
Subject Topic: mod_rewrite Redirect 301
Author
Message |
infoelba
Newbie


Joined: 04 August 2010
Posts: 2
Posted: 04 August 2010 at 5:17am

Hello, I update from ISAPI_Rewrite to Helicon Ape some days ago.
mod_rewrite rules were working good on I_R, but they don't on Ape.

My R=301 rules are applied, but the address in the browser bar doesn't change.

Code:

# Helicon Ape version 3.0.0.44

RewriteEngine on
RewriteBase /

RewriteMap types txt:inc/urlrewritemappings/types.txt
RewriteMap zones txt:inc/urlrewritemappings/zones.txt
RewriteMap advancedsearch txt:inc/urlrewritemappings/advancedsearch.txt

RewriteMap lower int:tolower

RewriteRule index_asp/Lingua-IT/    /isola-d-elba/    [R=301]
RewriteRule web_cam            /web-cam/        [R=301]
RewriteRule staff\.htm            /web-project/    [R=301]

# cutted


these are the rules which don't work. They redirect to the correct pages, but the browser bar doesn't change.

Any idea?
Thanks in advance.
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 04 August 2010 at 5:30am

Strange enough...
Please enable rewrite logging in httpd.conf by putting the following directive:

RewriteLogLevel 9

Make the problematic request and show me the rewrite.log records for the request. Will try to figure it out.

__________________
Regards,
Anton
Back to Top
 
infoelba
Newbie


Joined: 04 August 2010
Posts: 2
Posted: 04 August 2010 at 5:52am

Thank you for replying. I put all my .htaccess here so you can understand better:

Code:

# Helicon Ape version 3.0.0.44

RewriteEngine on
RewriteBase /

RewriteMap types txt:inc/urlrewritemappings/types.txt
RewriteMap zones txt:inc/urlrewritemappings/zones.txt
RewriteMap advancedsearch txt:inc/urlrewritemappings/advancedsearch.txt

RewriteMap lower int:tolower

RewriteRule \.(js|txt|gif|jpe?g|css|ico)$ - [L]

RewriteRule index_asp/Lingua-IT/    /isola-d-elba/    [R=301]
RewriteRule web_cam            /web-cam/        [R=301]
RewriteRule staff\.htm            /web-project/    [R=301]

RewriteCond %{QUERY_STRING} ^stampa
RewriteRule ^(.*)$ $1? [R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule ^(.*)$ $1/ [R=301]

# regole infoelba vecchio
RewriteRule ^appuntamenti/index_asp/maincat-appuntamenti/catsub-            /manifestazioni-eventi/        [R=301]
RewriteRule ^web_project/portfolio_asp/maincat-web_project/catsub-portfolio        /web-project/            [R=301]

RewriteRule ^curiosita-isola-d-elba/([^/]*)_([0-9]+)\.asp$                /curiosita-isola-d-elba/scheda.asp?curiosita=$2&maincat=curiosita-isola-d-elba        [L,QSA]

RewriteRule ^isola-d-elba/spiagge/spiaggia-([^/]*)\.asp$                /isola-d-elba/spiagge/scheda.asp?spiaggia=$1&maincat=isola-d-elba&subcat=spiagge    [L,QSA]

RewriteRule ^dove-dormire/([^/]*)/nelle-vicinanze-di-([^/]*)/$                /strutture/lista-vicinanze.asp?tipo=${types:$1}&spiaggia=$2&maincat=dove-dormire&subcat=$1    [L,QSA]

RewriteCond ${advancedsearch:$2|Unknown} !Unknown
RewriteRule ^dove-dormire/([^/]*)/([^/]*)/$        /strutture/lista-$2.asp?tipo=${types:$1}&maincat=dove-dormire&subcat=$1        [L]

RewriteCond strutture-${advancedsearch:$1|Unknown} !strutture-Unknown
RewriteRule ^dove-dormire/strutture-([^/]*)/$        /strutture/lista-$1.asp?maincat=dove-dormire&subcat=$1    [L]

RewriteRule ^dove-dormire/agenzie/$                            /dove-dormire/agenzie/?maincat=dove-dormire&subcat=agenzie    [L]
RewriteRule ^dove-dormire/bed-and-breakfast/$                    /strutture/listaBB.asp?maincat=dove-dormire&subcat=bed-and-breakfast    [L]
#RewriteRule ^dove-dormire/([^/]*)/$                            /strutture/lista.asp?tipo=${types:$1}&maincat=dove-dormire&subcat=$1 [QSA,L]
RewriteRule ^dove-dormire/([^/]*)/$                            /strutture/lista.asp?tipo=$1&maincat=dove-dormire&subcat=$1 [L]
RewriteRule ^dove-dormire/([^/]*)/comune-([^/]*)/$                /strutture/lista.asp?tipo=${types:$1}&comune=${types:$2}&maincat=dove-dormire&subcat=$1&n_comune=$2        [L]
RewriteRule ^dove-dormire/([^/]*)/localita-([^/]*)/$                /strutture/lista.asp?tipo=${types:$1}&localita=${zones:$2}&maincat=dove-dormire&subcat=$1&n_localita=$2        [L]
RewriteRule ^dove-dormire/([^/]*)/versante-([^/]*)/$                /strutture/lista.asp?tipo=${types:$1}&versante=${types:$2}&maincat=dove-dormire&subcat=$1 [L]
RewriteRule ^dove-dormire/([^/]*)/([0-9]{1})-(stelle|spighe|chiavi)/$            /strutture/lista.asp?tipo=${types:$1}&categoria=$2&maincat=dove-dormire&subcat=$1 [L]
RewriteRule ^(dove-dormire|dove-mangiare|noleggi|sport|servizi-balneari|servizi|shopping)/([^/]*)/([^/]*)/$            /strutture/scheda.asp?struttura=$3&tipo=${types:$2}&maincat=$1&subcat=$2 [L]

RewriteRule ^(dove-dormire|dove-mangiare|noleggi|sport|servizi-balneari|servizi|shopping)/([^/]*)/([^/]*)/([0-9]{1})/$        /strutture/scheda.asp?struttura=$3&tipo=${types:$2}&pagina=$4&maincat=$1&subcat=$2 [L]
RewriteRule ^(dove-dormire|dove-mangiare|noleggi|sport|servizi-balneari|servizi|shopping)/([^/]*)/([^/]*)/([^/]*).asp$        /strutture/$4.asp?struttura=$3&tipo=${types:$2}&maincat=$1&subcat=$2 [L]

RewriteRule ^annunci-immobiliari/comune-([^/]*)/$        /annunci-immobiliari/index.asp?comune=${types:$1}&maincat=annunci-immobiliari            [L]
RewriteRule ^annunci-immobiliari/([0-9]+)-([^/]*)/$        /annunci-immobiliari/scheda.asp?annuncio=$1&maincat=annunci-immobiliari                [L]

RewriteRule ^invio-richieste/soggiorni/([^/]*)/versante-([^/]*)/$            /invio-richieste/soggiorni/?tipo=${types:$1}&versante=${types:$2} [L]
RewriteRule ^invio-richieste/soggiorni/([^/]*)/versante-([^/]*)/richiesta-inviata\.asp$    /invio-richieste/soggiorni/richiesta-inviata.asp [L]

# regole generiche
RewriteRule ^([^/]*)/$                    /$1/?maincat=$1                [L]
RewriteRule ^([^/]*)/([^/]*)\.asp$            /$1/$2.asp?maincat=$1            [L]
RewriteRule ^([^/]*)/([^/]*)/$                /$1/$2/?maincat=$1&subcat=$2        [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.asp$        /$1/$2/$3.asp?maincat=$1&subcat=$2    [L]



here is part of the log:
Code:


[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (1) [perdir c:\webspace\infoelba\www\] init rewrite engine with /staff.htm
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (5) [perdir c:\webspace\infoelba\www\] strip matching prefix: /staff.htm -> staff.htm
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern \.(js|txt|gif|jpe?g|css|ico)$ to uri staff.htm
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (5) [perdir c:\webspace\infoelba\www\] strip matching prefix: /staff.htm -> staff.htm
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern index_asp/Lingua-IT/ to uri staff.htm
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (5) [perdir c:\webspace\infoelba\www\] strip matching prefix: /staff.htm -> staff.htm
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern web_cam to uri staff.htm
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (5) [perdir c:\webspace\infoelba\www\] strip matching prefix: /staff.htm -> staff.htm
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern staff\.htm to uri staff.htm
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (2) [perdir c:\webspace\infoelba\www\] escaping /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (2) [perdir c:\webspace\infoelba\www\] forcing responsecode 301 for http://www.elbaisola.it/web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^(.*)$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (4) [perdir c:\webspace\infoelba\www\] RewriteCond: input='' pattern='^stampa' => not-matched
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^(.*)$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (4) [perdir c:\webspace\infoelba\www\] RewriteCond: input='C:\webspace\infoelba\www\staff.htm' pattern='-f' => matched
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (4) [perdir c:\webspace\infoelba\www\] RewriteCond: input='/staff.htm' pattern='(\.[a-zA-Z0-9]{1,5}|/)$' => not-matched
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^appuntamenti/index_asp/maincat-appuntamenti/catsub- to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^web_project/portfolio_asp/maincat-web_project/catsub-portfolio to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^curiosita-isola-d-elba/([^/]*)_([0-9]+)\.asp$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^isola-d-elba/spiagge/spiaggia-([^/]*)\.asp$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^dove-dormire/([^/]*)/nelle-vicinanze-di-([^/]*)/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^dove-dormire/([^/]*)/([^/]*)/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^dove-dormire/strutture-([^/]*)/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^dove-dormire/agenzie/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^dove-dormire/bed-and-breakfast/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^dove-dormire/([^/]*)/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^dove-dormire/([^/]*)/comune-([^/]*)/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^dove-dormire/([^/]*)/localita-([^/]*)/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^dove-dormire/([^/]*)/versante-([^/]*)/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^dove-dormire/([^/]*)/([0-9]{1})-(stelle|spighe|chiavi)/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^(dove-dormire|dove-mangiare|noleggi|sport|servizi-balneari|servizi|shopping)/([^/]*)/([^/]*)/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^(dove-dormire|dove-mangiare|noleggi|sport|servizi-balneari|servizi|shopping)/([^/]*)/([^/]*)/([0-9]{1})/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^(dove-dormire|dove-mangiare|noleggi|sport|servizi-balneari|servizi|shopping)/([^/]*)/([^/]*)/([^/]*).asp$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^annunci-immobiliari/comune-([^/]*)/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^annunci-immobiliari/([0-9]+)-([^/]*)/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^invio-richieste/soggiorni/([^/]*)/versante-([^/]*)/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^invio-richieste/soggiorni/([^/]*)/versante-([^/]*)/richiesta-inviata\.asp$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^([^/]*)/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^([^/]*)/([^/]*)\.asp$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (3) [perdir c:\webspace\infoelba\www\] applying pattern ^([^/]*)/([^/]*)/$ to uri /web-project/
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (1) [perdir c:\webspace\infoelba\www\] Rewrite URL to >> //web-project/?maincat=&subcat=web-project [REWRITE]
[04/ago/2010:12:08:55] [www.elbaisola.it/sid#3][rid#11404313/initial] (1) [perdir c:\webspace\infoelba\www\] Rewrite URL /staff.htm to >> /web-project/ [INTERNAL_REDIRECT]


I think the problem is that INTERNAL_REDIRECT...

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 04 August 2010 at 7:21am

Please try to add the [L] flag to your redirect rules. This may be the issue.

__________________
Regards,
Anton
Back to Top
 
Kurisotofa
Newbie


Joined: 06 September 2010
Location: Belgium
Posts: 5
Posted: 07 September 2010 at 8:32am

It's a bit strange that APE requires both the [R=301] and the [L] flag, isn't is?
ISAPI Rewrite 3.0 only needed the [R=301] flag.

Unfortunately, all our old .htaccess files (used by ISAPI Rewrite) only contain a [R=301] flag, no [L] flag.
Isn't there an option somewhere in the httpd.conf file that forces the address bar to change when [R=301] is specified?
Back to Top Visit Kurisotofa's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 09 September 2010 at 5:38am

Hello,

It is not a requirement. Any flag is only an option that is used for your particular needs.
[L] flag forces HeliconApe and ISAPI_Rewrite to skip looking through the rest of the rule while there's one that has been
matched. Combination of [R=301] and [L] will provide more clean processing of the request.

Regards
Andrew
Back to Top
 

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

Printable version Printable version