This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Rewrite swedish characters
Author
Message |
alfonzaberg
Newbie


Joined: 16 December 2010
Location: Sweden
Posts: 15
Posted: 28 January 2011 at 4:55am

Hello,
I have some problem with swedish characters in this rule:
RewriteRule ^articles/([^/]+)/?$ index.asp?
page=articles&cat=$1 [NC,L]

If I have a link like this:
articles/åäöÅÄÖ
the characters gets messed up when read on the page.

Is there any way that I can replace those type of
characters like:
articles/aaaeoeAAAEOE

and still have the original url like:
articles/åäöÅÄÖ
?

Thanks!

Regards

Niclas

Edited by alfonzaberg - 28 January 2011 at 5:02am
Back to Top
 
alfonzaberg
Newbie


Joined: 16 December 2010
Location: Sweden
Posts: 15
Posted: 28 January 2011 at 11:20am

anybody know if it is possible to just replace the
characters in $1?
Back to Top
 
alfonzaberg
Newbie


Joined: 16 December 2010
Location: Sweden
Posts: 15
Posted: 29 January 2011 at 7:25am

I really could use some help on this.

I tried this:
RewriteCond %{QUERY_STRING} ^(.*)(ä)(.*)$
RewriteRule (.*) $1\?%1%3? [N,NC,R=301]

But I didnt notice any change..

/Niclas
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 31 January 2011 at 4:35am

Hello,

Please, pay attention to NE and NU flags in documentation.

Regards
Andrew
Back to Top
 
alfonzaberg
Newbie


Joined: 16 December 2010
Location: Sweden
Posts: 15
Posted: 02 February 2011 at 3:30am

Hi and thanks!

I think I understand better with the NE and NU flags.

This is what I have:
Code:
RewriteCond %{QUERY_STRING} ^(.*)$ [NU]
RewriteRule (.*) $1 [NU]


But it doesnt seem to work..

I want special characters in querystrings to be replace
with hex
values, while still keeping the url in browser.

What am I missing?

Thank you!

Edited by alfonzaberg - 02 February 2011 at 3:37am
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 02 February 2011 at 9:13am

Please, provide the rewrite.log for the testing request.
Logging issues described in FAQ.

Please, also provide information on you build.

Regards
Andrew
Back to Top
 
alfonzaberg
Newbie


Joined: 16 December 2010
Location: Sweden
Posts: 15
Posted: 09 February 2011 at 4:33am

Hi again,

Currently I'm renting web space at a hotel, and it seems
that most of the things described in the FAQ I cannot
find/do.

Should the above work, or is it plain wrong?

I still cant manage to get it quite right.

Thanks again!
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 09 February 2011 at 7:49am

Understand. What is your build?
The latest one is 79 and it has encoding issues fixed. That must be the main reason you can't get it right.

Regards
Andrew
Back to Top
 
alfonzaberg
Newbie


Joined: 16 December 2010
Location: Sweden
Posts: 15
Posted: 13 February 2011 at 1:22pm

Hi,

I don't know what my build is, but I finally got it
working.. Almost.

This works great:
Code:
RewriteRule ^om-mig/([^/]+)/?$ index.asp?page=om-
mig&subpage=$1 [NC,L,NU]


But this is causing a "HTTP Error 404.0 - Not Found":
Code:
RewriteRule ^hitta-en-guide/([^/]+)/?$ index.asp?
page=hitta-en-guide&footer=true&CountyName=$1 [NC,L,NU]


How could that be?

Thanks

/Alfons
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 14 February 2011 at 2:11pm

Hello Alfons,

Does the link http://www.yourdomain.com/index.asp?page=hitta-en-guide&footer=true&CountyName=XXX work by itself?
At least, this is not the encoding issue any more ))


Regards
Andrew

Back to Top
 
alfonzaberg
Newbie


Joined: 16 December 2010
Location: Sweden
Posts: 15
Posted: 15 February 2011 at 1:33am

Hmm weird.

This doesn't work:
http://www.yourdomain.com/index.asp?page=hitta-en-guide&footer=true&CountyName=XXX

Although it doesn't give a "HTTP Error 404.0 - Not Found", it just doesn't do anything and I remain on my start
page.

One more thing that is weird, this:
http://www.yourdomain.com/index.asp?page=om-mig&subpage=$1

Behaves exactly the same as the link above, it doesn't do anything.

If i remove the [NU] flags it works:
Code:
RewriteRule ^hitta-en-guide/([^/]+)/?$ index.asp?page=hitta-en-guide&footer=true&CountyName=$1 [NC,L]


But the Swedish characters becomes weird.

Here is my complete modified .htaccess with comments:

Code:
RewriteEngine on
# THIS IS WORKING
RewriteRule index.asp start
RewriteRule start index.asp?page=start

# THIS IS NOT WORKING
RewriteRule ^hitta-en-gäde/([^/]+)/?$ index.asp?page=hitta-en-gade&footer=true&CountyName=$1 [NC,L,NU]

# THIS IS WORKING
RewriteRule ^hitta-en-gäde/?$ index.asp?page=hitta-en-gade [NC,L]
RewriteRule ^gäde/([^/]+)/?$ index.asp?page=pt&PtId=$1 [NC,L]
RewriteRule ^gäde/?$ index.asp?page=gade [NC,L]

# THIS IS WORKING
RewriteRule ^artiklar/([^/][0-9]+)/([^/]+)/?$ index.asp?page=artiklar&year=$1&month=$2 [NC,L]
RewriteRule ^artiklar/([^/]+)/?$ index.asp?page=artiklar&cat=$1 [NC,L,NU]
RewriteRule ^artiklar/?$ index.asp?page=artiklar [NC,L]

# THIS IS WORKING
RewriteRule ^artikel/([^/]+)/?$ index.asp?page=artikel&ArticleId=$1 [NC,L,NU]

# THIS IS WORKING
RewriteRule ^om-mig/([^/]+)/?$ index.asp?page=om-mig&subpage=$1 [NC,L,NU]
RewriteRule ^om-mig/?$ index.asp?page=om-mig [NC,L]

# THIS IS WORKING
RewriteRule ^min-sida/([^/]+)/?$ index.asp?page=min-sida&subpage=$1 [NC,L,NU]
RewriteRule ^min-sida/?$ index.asp?page=min-sida [NC,L,NU]

# RewriteCond %{HTTPS} (on)?
# RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
# RewriteCond %{REQUEST_URI} (.+)
# RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]


What could be wrong?

Many thanks!

/Alfons
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 17 February 2011 at 4:59am

Alfons, what is your server settings location? Is it
swedish?


Regards
Andrew
Back to Top
 
alfonzaberg
Newbie


Joined: 16 December 2010
Location: Sweden
Posts: 15
Posted: 17 February 2011 at 9:39am

I don't know but probably since I'm hiring web space in a
Swedish company.

It is weird that everything works except for that line..

Regards

Alfons

Edited by alfonzaberg - 17 February 2011 at 9:41am
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 18 February 2011 at 5:28am

Is remote session as option for you? We can connect and take a look.

Regards
Andrew
Back to Top
 
alfonzaberg
Newbie


Joined: 16 December 2010
Location: Sweden
Posts: 15
Posted: 18 February 2011 at 10:37am

Unfortunately it is not possible.

The only difference with the non-working rule is that it
has a swedish character in the rule and that it has a
second querystring(footer) which is set to true. I can't
see why this doesn't work while all the other rules work
(which I copied from the non-working).
/Alfons
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 21 February 2011 at 5:17am

IS there a way, that you simply use an old build?
All encoding problems were fixed before.

Regards
Andrew
Back to Top
 
alfonzaberg
Newbie


Joined: 16 December 2010
Location: Sweden
Posts: 15
Posted: 21 February 2011 at 7:08am

Andrew, actually I don't know.

What could be different between these two
Code:
RewriteRule ^hitta-en-gäde/([^/]+)/?$ index.asp?page=hitta-en-gade&footer=true&CountyName=$1 [NC,L,NU]

And
Code:
RewriteRule ^om-mig/([^/]+)/?$ index.asp?page=om-mig&subpage=$1 [NC,L,NU]


Which both has swedish characters in the $1..

Could their position in the file be important?

Regards

Alfons
Back to Top
 
alfonzaberg
Newbie


Joined: 16 December 2010
Location: Sweden
Posts: 15
Posted: 21 February 2011 at 8:29am

I noticed that it doesnt matter if there is a Swedish
character in the querystring or not, this doesnt even work:
http://www.domain.se/hitta-en-gäde/stockholm

Edited by alfonzaberg - 21 February 2011 at 8:29am
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 22 February 2011 at 8:49am

Well,

We figured out ISAPI_Rewrite is basically working and doing the actual rules.
Regarding this particular issue you can't provide logs or do the online meeting to take a look.
Obviously, the issue is on your side considering some server settings and has nothing to do with our product.
We'd be happy to help you in case any additional information is available.


Regards
Andrew
Back to Top
 
alfonzaberg
Newbie


Joined: 16 December 2010
Location: Sweden
Posts: 15
Posted: 22 February 2011 at 1:42pm

I understand. I still think this has something to do with
ISAPI.

This url works:
Code:
http://www.domain.se/hitta-en-gäde/stockholm

with this rule:
Code:
RewriteRule ^hitta-en-gäde/([^/]+)/?$ index.asp?
page=hitta-en-gade&footer=true&CountyName=$1 [NC,L]

but not with this rule:
Code:
RewriteRule ^hitta-en-gäde/([^/]+)/?$ index.asp?
page=hitta-en-gade&footer=true&CountyName=$1 [NC,L,NU]

Which is the same but with "NU" in the end.

Edited by alfonzaberg - 22 February 2011 at 1:42pm
Back to Top
 

Page of 2 Next >>
 
Printable version Printable version