LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-10-2009, 04:06 AM   #1
xiutuo
Member
 
Registered: Mar 2008
Posts: 55

Rep: Reputation: 15
apache rewrite F problem


my env:
apache+ resin

url specical character like: . /
apache transtlate . to %2e and / to %2f
i have uri like this:
http://www.exaplem.com/test.jsp
when user type the url on the browser :
http://www.exaplem.com/test%2ejsp
it will auto translate to 'http://www.exaplem.com/test.jsp'
i dont want this happen


so i write a rewrite rule :

RewriteEngine on
RewriteCond %{QUERY_STRING} test\%2ejsp
RewriteRule .*$ - [F,L]

anyway,it dont work fine..

anybody any suggestion will help me out..

thx...
 
Old 09-10-2009, 05:47 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Hi,

After doing some tests, it looks like that even though the browser sends the correct URI (test%2ejsp), apache replaces the hex value with the corresponding character, so the rewrite does not work.
It looks that you have to use the following:
Code:
RewriteEngine on

RewriteCond %{THE_REQUEST} ^GET\ /test%2ehtm
RewriteRule ^(.*)$ - [NE,F]
Regards

Last edited by bathory; 09-11-2009 at 01:56 AM.
 
Old 09-10-2009, 10:04 PM   #3
xiutuo
Member
 
Registered: Mar 2008
Posts: 55

Original Poster
Rep: Reputation: 15
thx for you reply,.

i will try it,more information will be post
 
Old 09-10-2009, 10:48 PM   #4
xiutuo
Member
 
Registered: Mar 2008
Posts: 55

Original Poster
Rep: Reputation: 15
thanks very much

apache access request url like this :
1.
GET /game/nwap/fee%2ejsp?p=581:lx_xqdapklzji760,1,3:N:LENOVO-I760:,R9000011-0,&gameShortName=lx_xqdapklzji760&MISC_ID=999&MISC_SessionID=999-11062c51!-1667351867!1417680609!1252640404578&MISC_ServiceID=32010307&MISC_AccessMode=2&MISC_MID=0011027788824 5

2.
/wap/zy/nba/fee%2ejsp?g=g&zz=zz&ac=suc&ct=dou&yin_money=16&channel=bjwap&from=3gpp4&yuan_money=2&flag=f3gpp4&ord er_id=292865&code=dcec5683E35A8e35a83a83d996ad7878557457F43E834518&len=5,33&session=X31U2XrU2UU1XMWS WOUr&time_rand=1252640502&turl=http://mo.pp.cn/ppdou/i.php&time_code=2E5ED68572CDF7E5B77523F3609C3606&MISC_ID=999&MISC_SessionID=999-fd68c98!-1667351867!1417680609!1252640504102&MISC_ServiceID=32010220&MISC_AccessMode=2&MISC_MID=ACIR%2F%2F%2B QBUH%2F%2F%2F8BWf%2F%2F%2FyY8eEE52HNqUwQg6UvXfhg%3D

3. /other/oo/fee%2ejsp?kkksdf=ll?lld=9

……
some url like these..

my rewrite rule :

RewriteEngine on

RewriteCond %{THE_REQUEST} ^GET\ (.*)fee%2ejsp
RewriteRule ^(.*)$ - [NE,F]

it works ...
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Rewrite mahmoud Linux - Software 2 11-11-2008 07:52 AM
Apache Rewrite mahmoud Linux - Newbie 2 10-08-2008 08:11 AM
Problem with Apache rewrite griffey Linux - Software 1 08-10-2007 06:19 AM
apache rewrite help deesto Linux - Server 3 11-03-2006 02:07 PM
Need help with Apache rewrite kinetik Linux - General 6 05-19-2006 06:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration