Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
mod_rewrite: it cut a part of querystring
Old 10-06-2010, 04:07 AM mod_rewrite: it cut a part of querystring
Novice Talker

Posts: 14
Location: Italy
Trades: 0
Hi guys!
I created this rewrite rule:
Code:
RewriteRule ^corsi/([a-z\-]*)[^\.a-z] search.php?tag=$1 [L]
It should filter URL:
the one with extension (.php, .htm, .asp and so on) is not rewritten, all the others (ie. corsi/new-class-for-kids) are rewritten to search.php?tag=xxxxxx
It works, but it returns me only a part of the querystring:
the link corsi/new-class-for-kids is rewritten in search.php?tag=new-class-for (note that a part of querystring is missing).

Can anyone help me?
ninjaweb is offline
Reply With Quote
View Public Profile Visit ninjaweb's homepage!
 
 
Register now for full access!
Old 10-06-2010, 05:40 AM Re: mod_rewrite: it cut a part of querystring
Novice Talker

Posts: 14
Location: Italy
Trades: 0
I changed the rule in:
Code:
RewriteRule ^corsi/([a-z\-]+)[^\.a-z{3,4}]? search.php?tag=$1 [L]
Now the querystring issue has gone. But now if I type corsi/something.php the rules rewrites the URL (I don't want the rewriting method if the url contains the extension).

Any idea?
ninjaweb is offline
Reply With Quote
View Public Profile Visit ninjaweb's homepage!
 
Old 10-06-2010, 06:51 AM Re: mod_rewrite: it cut a part of querystring
Novice Talker

Posts: 14
Location: Italy
Trades: 0
Issue solved, now it works.
Code:
RewriteEngine On
#rewrites the url to search.php if the URL has no extension only (php or any other else)
RewriteCond %{SCRIPT_FILENAME} !\.[a-z] 
RewriteRule ^corsi/([a-z\-]+) search.php?tag=$1 [L]
ninjaweb is offline
Reply With Quote
View Public Profile Visit ninjaweb's homepage!
 
Reply     « Reply to mod_rewrite: it cut a part of querystring
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11938 seconds with 12 queries