| Author |
|
Bender Newbie

Joined: 09 November 2004 Location: Switzerland
Online Status: Offline Posts: 26
|
| Posted: 16 May 2008 at 6:53am | IP Logged
|
|
|
Hi
I'm new to ISAPI 3 and I'm not sure if I correctly understoot the rewriting idea. I've got a country list
Amerika
Argentinien
Australien
...
With links
/shop/biere/land.asp?HERKUNFTLAND_ID=17
/shop/biere/land.asp?HERKUNFTLAND_ID=18
/shop/biere/land.asp?HERKUNFTLAND_ID=19
...
Now I'd like to make these links search-engine friendly. Is it right that I've got to change the links in my country links to for example to:
/shop/biere/Amerika-17.html
but leaving the original land.asp page on the server? Is the following rewrite rule correct:
RewriteEngine On
RewriteCompatibility2 On
RepeatLimit 200
RewriteBase /
# unsupported directive: [ISAPI_Rewrite]
# Biere Landauswahl
^shop/biere/.*-([0-9]+)\.html$ shop/biere/land.asp?HERKUNFTLAND_ID=$1 [NC,L]
Thanks for any help in advance!
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 4146
|
| Posted: 19 May 2008 at 3:24am | IP Logged
|
|
|
Here's the config you need:
RewriteEngine On
RewriteBase /
# Biere Landauswahl
RewriteRule ^shop/biere/\w+-(\d+)\.html$ shop/biere/land.asp?HERKUNFTLAND_ID=$1 [NC,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
Bender Newbie

Joined: 09 November 2004 Location: Switzerland
Online Status: Offline Posts: 26
|
| Posted: 19 May 2008 at 4:22am | IP Logged
|
|
|
Thanks, works perfect :)
|
| Back to Top |
|
| |
Bender Newbie

Joined: 09 November 2004 Location: Switzerland
Online Status: Offline Posts: 26
|
| Posted: 19 May 2008 at 5:51am | IP Logged
|
|
|
I encountered a Problem with white spaces. How do I handle countries like "South Afrika"?
|
| Back to Top |
|
| |
Yaroslav Moderator Group

Joined: 15 August 2002
Online Status: Offline Posts: 6455
|
| Posted: 19 May 2008 at 8:04am | IP Logged
|
|
|
RewriteEngine On
RewriteBase /
# Biere Landauswahl
RewriteRule ^shop/biere/[^/]+-(\d+)\.html$ shop/biere/land.asp?HERKUNFTLAND_ID=$1 [NC,L]
__________________ Yaroslav Govorunov,
Helicon Tech
|
| Back to Top |
|
| |
Bender Newbie

Joined: 09 November 2004 Location: Switzerland
Online Status: Offline Posts: 26
|
| Posted: 19 May 2008 at 8:21am | IP Logged
|
|
|
Thanks a lot! What an excellent support!
But I encounter now a problem with
RewriteRule ^shop/biere/[^/]+-(\d+)-[^/]+-(\d+)-[^/]+-(\d+)\.html$ shop/biere/details_test.asp?HERKUNFTLAND_ID=$1&PRODUZENT_ID=$2&ArtikelNr=$3 [NC,L]
That doesn't work anymore ...
Edited by Bender - 19 May 2008 at 8:24am
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 4146
|
| Posted: 20 May 2008 at 1:48am | IP Logged
|
|
|
This config should work for you:
RewriteEngine On
RewriteBase /
# Biere Landauswahl
RewriteRule ^shop/biere/[^/-]+-(\d+)\.html$ shop/biere/land.asp?HERKUNFTLAND_ID=$1 [NC,L] RewriteRule ^shop/biere/[^/-]+-(\d+)-[^/-]+-(\d+)-[^/-]+-(\d+)\.html$
shop/biere/details_test.asp?HERKUNFTLAND_ID=$1&PRODUZENT_ID=$2&ArtikelNr=$3
[NC,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
Bender Newbie

Joined: 09 November 2004 Location: Switzerland
Online Status: Offline Posts: 26
|
| Posted: 20 May 2008 at 4:55am | IP Logged
|
|
|
Works perfect! Thx
|
| Back to Top |
|
| |
Bender Newbie

Joined: 09 November 2004 Location: Switzerland
Online Status: Offline Posts: 26
|
| Posted: 20 May 2008 at 11:00am | IP Logged
|
|
|
It looks like the devil is in the detail ...
How can I mask "-" that are inside words (El-Torro)?
www.xyz.com/shop/biere/Argentina-17-El-Torro-34-Best Wine-324.html
RewriteRule ^shop/biere/[^/]+-(\d+)-[^/]+-(\d+)-[^/]+-(\d+)\.html$ shop/biere/details_test.asp?HERKUNFTLAND_ID=$1&PRODUZENT_ID=$2&ArtikelNr=$3 [NC,L]
Thanks again for any help!
Edited by Bender - 20 May 2008 at 11:00am
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 4146
|
| Posted: 21 May 2008 at 3:56am | IP Logged
|
|
|
The rule you provided in your last post should work for www.xyz.com/shop/biere/Argentina-17-El-Torro-34-Best Wine-324.html correctly.
__________________ Regards,
Anton
|
| Back to Top |
|
| |
Bender Newbie

Joined: 09 November 2004 Location: Switzerland
Online Status: Offline Posts: 26
|
| Posted: 21 May 2008 at 3:56am | IP Logged
|
|
|
It's not working, maybe the problem is somewhere else?
Please have a look at the page:
http://www.ullrich.ch/shop/whisky/Whiskylik%F6r-92.html
And click on one of the products with a "-" in its name.
The rule is also not working for names like
Single Malt "M"
I'm using the following rule:
# Whisky Land/Region/Produzent/ArtikelNr
RewriteRule ^shop/whisky/[^/-]+-(\d+)-[^/-]+-(\d+)-[^/-]+-(\d+)-[^/-]+-(\d+)\.html$ shop/whisky/details.asp?HERKUNFTLAND_ID=$1&HERKUNFTREGION_ID=$2&PRODUZENT_ID=$3&ArtikelNr=$4 [NC,L]
Edited by Bender - 21 May 2008 at 5:12am
|
| Back to Top |
|
| |
Bender Newbie

Joined: 09 November 2004 Location: Switzerland
Online Status: Offline Posts: 26
|
| Posted: 22 May 2008 at 2:44am | IP Logged
|
|
|
How do I rewrite the ArtikelNr if it's like 21340.1 instead of a number without a point?
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 4146
|
| Posted: 22 May 2008 at 5:51am | IP Logged
|
|
|
Please try to use this rule:
RewriteRule ^shop/whisky/[^/-]+-(\d+)-[^/-]+-(\d+)-[^/-]+-(\d+)-[^/]+-([^/-]+)\.html$ shop/whisky/details.asp?HERKUNFTLAND_ID=$1&HERKUNFTREGION_ID=$2&PRODUZENT_ID=$3&ArtikelNr=$4 [L,NC]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
Bender Newbie

Joined: 09 November 2004 Location: Switzerland
Online Status: Offline Posts: 26
|
| Posted: 22 May 2008 at 6:32am | IP Logged
|
|
|
Thx Anton
I still got the problem that the rewriting is not working when a word contains a -
|
| Back to Top |
|
| |
Bender Newbie

Joined: 09 November 2004 Location: Switzerland
Online Status: Offline Posts: 26
|
| Posted: 22 May 2008 at 8:59am | IP Logged
|
|
|
Words like
Single Malt Cask No. 687 bot. 90/151 Signatory
Also don't work
|
| Back to Top |
|
| |
Bender Newbie

Joined: 09 November 2004 Location: Switzerland
Online Status: Offline Posts: 26
|
| Posted: 23 May 2008 at 2:40am | IP Logged
|
|
|
I still need some help with rewriting words containing
white spaces an/or -
when using the following rules:
# Whisky Land/Region/Produzent/ID_NR_Art
RewriteRule ^shop/whisky/[^/-]+-(\d+)-[^/-]+-(\d+)-[^/-]+-(\d+)-[^/-]+-(\d+)\.html$ shop/whisky/details.asp?HERKUNFTLAND_ID=$1&HERKUNFTREGION_ID=$2&PRODUZENT_ID=$3&ID_NR_Art=$4 [NC,L]
Example link to be rewritten:
shop/whisky/Whiskylikor-92-Alle-4-Marlfield-1221-Old Irish Whiskey-Likor-17729.html
Might it help switching from - to some other letter as separator? I tried different rules and all of them fail because of the - in the articles name.
Edited by Bender - 23 May 2008 at 3:28am
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 4146
|
| Posted: 23 May 2008 at 8:57am | IP Logged
|
|
|
It's not likely to have - for parameters separation and - inside parameters, it's difficult to distinguish them. Please try to change one of separators.
__________________ Regards,
Anton
|
| Back to Top |
|
| |
Bender Newbie

Joined: 09 November 2004 Location: Switzerland
Online Status: Offline Posts: 26
|
| Posted: 24 May 2008 at 2:37am | IP Logged
|
|
|
# Whisky Land/Region/Produzent/ID_NR_Art ~
RewriteRule ^shop/whisky/[^/~]+~(\d+)~[^/~]+~(\d+)~[^/~]+~(\d+)~[^/~]+~(\d+)\.html$ shop/whisky/details.asp?HERKUNFTLAND_ID=$1&HERKUNFTREGION_ID=$2&PRODUZENT_ID=$3&ID_NR_Art=$4 [NC,L]
Seems to work so far ...
Edited by Bender - 24 May 2008 at 3:08am
|
| Back to Top |
|
| |