logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: characters in url but not in query_string
Author
fenor



Joined: 21 Feb 2013
Posts: 5

PostPosted: Thu 21 Feb '13 17:12    Post subject: characters in url but not in query_string Reply with quote

Hi,

I have an url, e.g. http://localhost/service/szer....zodes../action/axgetszerzodesar/ugyfelid/46402/termekid/46032/szerzodesszam/2012.01.01...

I use htaccess to rewrite it to:
http://localhost/service/index.php?p=szer....zodes../action/axgetszerzodesar/ugyfelid/46402/termekid/46032/szerzodesszam/2012.01.01.../
and there is a problem, because I do not get what I need. The result is:
http://localhost/index.php?p=szer....zodes/action/axgetszerzodesar/ugyfelid/46402/termekid/46032/szerzodesszam/2012.01.01/
The last / sing dous not even matter, because if I write the url without the ending /, the three dots are still removed.

It looks like everywhere in the url the (in regexp) \.+\/ pattern is replaced with a simple / sign.
The RewriteRule is very simple, I can not imagine it has anything to do with this, but it looks this:
RewriteRule ^(.*)$ index.php?p=$1 [QSA]

I started to log the rewrite and it looks like if the specific parts of the url are replaced before the rewrite got it.
These are the first few rows of the rewrite log:
add path info postfix: E:/web/service/szerz....odes -> E:/web/service/szerz....odes/action/axgetszerzodesar/ugyfelid/46402/termekid/46032/szerzodesszam/2012.01.01/
strip per-dir prefix: E:/web/service/szerz....odes/action/axgetszerzodesar/ugyfelid/46402/termekid/46032/szerzodesszam/2012.01.01/ -> szerz....odes/action/axgetszerzodesar/ugyfelid/46402/termekid/46032/szerzodesszam/2012.01.01/
applying pattern '^(.*)$' to uri 'szerz....odes/action/axgetszerzodesar/ugyfelid/46402/termekid/46032/szerzodesszam/2012.01.01/'

webserver: Apache/2.2.22 (Win32) PHP/5.2.17
and Apache/2.2.9 (Win32) PHP/5.2.17 (I refreshed it today because of this problem)
os: win7 home premium sp1

It is tested on a linux os too, but there were no such problems.

Thanks for the help.
fenor
Back to top
cbj4074



Joined: 02 Nov 2012
Posts: 24
Location: United States

PostPosted: Thu 21 Feb '13 18:09    Post subject: Reply with quote

Could this be your problem?

https://issues.apache.org/bugzilla/show_bug.cgi?id=20036
Back to top
fenor



Joined: 21 Feb 2013
Posts: 5

PostPosted: Thu 21 Feb '13 18:35    Post subject: Reply with quote

I use php as module, not as CGI but it looks like that bug.
Back to top
cbj4074



Joined: 02 Nov 2012
Posts: 24
Location: United States

PostPosted: Thu 21 Feb '13 19:26    Post subject: Reply with quote

If it's the same issue, it sounds as though you have no choice but to change your URL structure and avoid the periods, or switch web-servers altogether.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 21 Feb '13 20:10    Post subject: Reply with quote

Could you please post a full example of the URL at pastebin?

Is that the only rewrite rule you have?
Back to top
fenor



Joined: 21 Feb 2013
Posts: 5

PostPosted: Fri 22 Feb '13 7:40    Post subject: Reply with quote

sorry, but what would you need on pastebin?

I rewrote my php to process the request_uri and not the _GET['p'] it looks it is working now.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 22 Feb '13 11:07    Post subject: Reply with quote

It would be nice to have all your RewriteRules and condition ;)If not too long you can post it in the forum.
Back to top
fenor



Joined: 21 Feb 2013
Posts: 5

PostPosted: Fri 22 Feb '13 11:08    Post subject: Reply with quote

http://pastebin.ca/2316621
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 22 Feb '13 11:23    Post subject: Reply with quote

You might try
Code:

RewriteEngine on
RewriteRule ^(favicon\.ico|robots\.txt|index\.php) - [L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?p=$1 [L]
Back to top
fenor



Joined: 21 Feb 2013
Posts: 5

PostPosted: Fri 22 Feb '13 11:36    Post subject: Reply with quote

nothing changed
Back to top


Reply to topic   Topic: characters in url but not in query_string View previous topic :: View next topic
Post new topic   Forum Index -> Apache