| Author |
Message |
Slackervaara
Newbie


Joined: Nov 03, 2007
Posts: 57
|
Posted:
Sun Jan 13, 2008 3:11 pm |
|
|
|
 |
Slackervaara
Newbie


Joined: Nov 03, 2007
Posts: 57
|
Posted:
Mon Jan 14, 2008 9:20 am |
|
I have been thinking on the problem and I think my problem here is caused by RewriteRule for this in .htaccess. The Scandinavian letters causing this is åäö, which comes after z in the Swedish alphabet.
This Rewriterule is probably making this:
RewriteRule ^search-([a-zA-Z0-9]*)-([0-9]*)-([0-9]*)-([/:\-\'{}()\,\._&a-zA-Z0-9+=\ ]*)-([a-zA-Z]*)-([0-9]*).html modules.php?name=Search&author=$1&topic=$2&min=$3&query=$4&type=$5&category=$6 [L]
I have modified:
-([/:\-\'{}()\,\._&a-zA-Z0-9+=\ ]*)-([a-zA-Z]*)-
to:
-([/:\-\'{}()\,\._&a-zA-Z0-9+=\å\ä\ö\ ]*)-([a-zA-Z]*)-
did not make any difference
-([/:\-\'{}()\,\._&a-öA-Ö0-9+=\ ]*)-([a-zA-Z]*)-
gave Internal server Error
-([/:\-\'{}()\,\._&a-zA-Z0-9+=\ ]*)-([a-zA-Z\å\ä\ö\]*)-
did not make any difference
The result of normal function of this link should be like this:
http://www.mysite.com/search--0-10-vara-stories-0.html
vara is the word that is put in the Search box. |
|
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 862
|
Posted:
Mon Jan 14, 2008 4:33 pm |
|
1. I need to know if the link is being shortened properly (i.e., when you view the link in the browser status bar, is it correct)?
2. Or, is the link appropriate, but when clicked you get a "404 Not Found" type error.
Just a side-note, one could also try using [[:alnum:]] instead of the [a-zA-Z\å\ä\ö\] and see if that works. |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
Slackervaara
Newbie


Joined: Nov 03, 2007
Posts: 57
|
Posted:
Mon Jan 14, 2008 4:58 pm |
|
| montego wrote: |
1. I need to know if the link is being shortened properly (i.e., when you view the link in the browser status bar, is it correct)?
2. Or, is the link appropriate, but when clicked you get a "404 Not Found" type error.
Just a side-note, one could also try using [[:alnum:]] instead of the [a-zA-Z\å\ä\ö\] and see if that works. |
1. The link is not shortened at all. This is the link, when I click on it:
http://www.mysite.com/search.html&author=&topic=0&min=10&query=tv%E5&type=stories&category=0
In the status bar it is:
http://www.mysite.com/search.html&author=&topic=0&min=10&query=två&type=stories&category=0
2. I get no error, when I click on the page. The searchbox is displayed, but there are no displayed search results beneath it.
I tried [[:alnum:]] but it did not make any difference. This is how I did it:
([[:alnum:]]*)-([[:alnum:]]*)- |
|
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 862
|
Posted:
Tue Jan 15, 2008 8:07 am |
|
You need to make sure and change the GT-Search.php script too under the ShortLinks directory in order to get the URL to be shortened.
I tested your
[a-zA-Z\å\ä\ö\]
and it definitely will not work. Try using this instead:
[a-zA-Zåäö]
You do not need to escape the additional characters.
Again, do not forget to change both GT-Search.php AND .htaccess to match. |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 862
|
Posted:
Tue Jan 15, 2008 8:08 am |
|
By the way, I also just now tested the following and it worked as well:
([/:\-\'{}()\,\._&[:alnum:]+= ]*)
See where/how I placed the [:alnum:] directive? |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
Slackervaara
Newbie


Joined: Nov 03, 2007
Posts: 57
|
Posted:
Wed Jan 16, 2008 10:10 pm |
|
Many thanks!
I have added as you suggested:
-([/:\-\'{}()\,\._&a-zåäöA-Z0-9+=\ ]*)-([a-zA-Z]*)-
and also åäö to GT-Search.php and it is working correct now. |
|
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 862
|
Posted:
Thu Jan 17, 2008 7:39 am |
|
Had you tried my [:alnum:] approach? Just curious as since I test mostly in english, it would be nice to know if what also solves the issue because I am hoping it takes your web site character set into consideration. |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
Slackervaara
Newbie


Joined: Nov 03, 2007
Posts: 57
|
Posted:
Thu Jan 17, 2008 10:16 am |
|
[:alnum:] worked, if I added it in .htaccess, but in GT-Search.php I had to have ;query=([a-zåäöA-Z0-9]*) to get it to work, because [:alnum:] did not work for search words with åäö in this file.
I think that people in Denmark, Norway and Germany can have similar problems like this. |
|
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 862
|
Posted:
Thu Jan 17, 2008 8:03 pm |
|
Ok. Good to know. That is what I was concerned about. The PHP functions themselves are PCRE based and not straight Perl and so that is not working.
Thank you for testing that out for me! |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
Slackervaara
Newbie


Joined: Nov 03, 2007
Posts: 57
|
Posted:
Sat Jan 19, 2008 9:34 pm |
|
BTW, it is a very similar problem with the Search of the Web_Links module, that is solved in almost identical fashion. |
|
|
|
 |
|
|