Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 75

PostPosted: Sun Jan 13, 2008 3:11 pm Reply with quote

When I use Search to search for an article with a word with Scandinavian letters it works normally until I hit Next results, which gives a page without any search results. If Shortlinks is disabled it works very well and there is no problem.
This is the link that gives no search results:
http://www.mysite.com/search.html&author=&topic=0&min=10&query=tv%E5&type=stories&category=0
 
View user's profile Send private message
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 75

PostPosted: Mon Jan 14, 2008 9:20 am Reply with quote

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.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 926

PostPosted: Mon Jan 14, 2008 4:33 pm Reply with quote

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 
View user's profile Send private message Visit poster's website
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 75

PostPosted: Mon Jan 14, 2008 4:58 pm Reply with quote

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:]]*)-
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 926

PostPosted: Tue Jan 15, 2008 8:07 am Reply with quote

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 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 926

PostPosted: Tue Jan 15, 2008 8:08 am Reply with quote

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 
View user's profile Send private message Visit poster's website
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 75

PostPosted: Wed Jan 16, 2008 10:10 pm Reply with quote

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.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 926

PostPosted: Thu Jan 17, 2008 7:39 am Reply with quote

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 
View user's profile Send private message Visit poster's website
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 75

PostPosted: Thu Jan 17, 2008 10:16 am Reply with quote

[: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.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 926

PostPosted: Thu Jan 17, 2008 8:03 pm Reply with quote

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 
View user's profile Send private message Visit poster's website
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 75

PostPosted: Sat Jan 19, 2008 9:34 pm Reply with quote

BTW, it is a very similar problem with the Search of the Web_Links module, that is solved in almost identical fashion.
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
Forum - Join the conversation on the Thoughts.com forums
Search Engine Ranking - Improve your SEO services. Premium Web content, intelligent links, quality optimization & competitive search engine placement. You deserve Better Rankings!
Executive Resumes - providing complimentary resume analysis
PhpNuke Themes
Lobo Links Web Directory
linear-bunch