Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Hey everybody, Im really confused about this problem. Ill try to describe it:

The problem is: http://mydomain.com/somedir/somephp.php?arg1=value&arg2=http://otherdomain.com&arg3=http://othertoo.com/somepath/something... is totatlly fails. With url encode and without too.

My site read in everything after mydomain.com/everything, except files and directories which are exists. I'm doing it with mod_rewrite:

Options -Indexes 

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ handler.php

The query example above is landing at handler.php. If I comment out the RewriteRule, there will be an apache error:

Forbidden

You don't have permission to access /somedir/somephp.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Lots of testing etc, Ive figured out that there is a problem with the http://, or :// string in the url arguments. But its coming in url encoded :S

This stuff should be an openId authentication system, and its fails at the postback, and Im sure the url in the url argument makes this error.

I never meet this problem before, altought, I did a lot of same thing. The url encode thing must work.

Please help me! Thanx!

share|improve this question

1 Answer 1

what means "totally fails"? what error code do you goet? what error in your server file? what shows up?

your rewrite rules are fine! the permission error doesnt matter as its not the file you want to serve, as long as handler.php is accessible.

however i think your error is that the config above is not exactly the one you tried. if you have it like this:

RewriteRule ^(.*)$ handler.php?a=b

you will loose ally our query string arguments, because its overwritten by a=b. what you then can do is the following:

RewriteRule ^(.*)$ handler.php?a=b [QSA]

which tells apache to append your query string (QSA=QueryStringAppend)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.