Passing full web address as an url parameter

Hi
I am trying to get a full web address from url with php (zend framework)
This is what I type to the browser
http://domain.com/service/index/index/url/http%3A%2F%2Fwww.google.co.uk

and in my action I do

        $url = $this->_getParam('url');
        echo $url;

but I get the following error

The requested URL /service/index/index/url/http://www.com was not found on this server.

Am I missing something here?
bilgehanyildirimAsked:
Who is Participating?
 
Richard QuadlingConnect With a Mentor Senior Software DeveloperCommented:
Try ...

http://domain.com/service/index/index/url/www.google.co.uk

What rewrite rules have you got defined?

What if the :// is NOT encoded?

http://domain.com/service/index/index/url/http://www.google.co.uk

0
 
bilgehanyildirimAuthor Commented:
Sorry, this question wasn't meant to be for netbeans channel!
0
 
Richard QuadlingSenior Software DeveloperCommented:
You have index/index/

Maybe too many indices?
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
bilgehanyildirimAuthor Commented:
no, service module index controller index action
0
 
bilgehanyildirimAuthor Commented:
and also if I do

http://domain.com/service/index/index/url/normal_string

I get normal_string
0
 
Richard QuadlingSenior Software DeveloperCommented:
Can you try ...

http://domain.com/service/index/index/url=http%3A%2F%2Fwww.google.co.uk


0
 
bilgehanyildirimAuthor Commented:
done that. exactly same result.
0
 
bilgehanyildirimAuthor Commented:
url without :// works fine. but if I put .../url/http://www... I only get http:

my .htaccess is

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]

and no special zend route defined.
0
 
Richard QuadlingSenior Software DeveloperCommented:
OOI, why are you calling _getParam() and not getParam() ...

My experience with ZF is very limited at the moment. I'm only using the Zend_SOAP Server and Client (building soap services for our clients - fun!).

Not used the MVC yet.

http://framework.zend.com/manual/en/zend.controller.request.html mentions getParams() and getParam() - no leading _ which is commonly used to indicate a private call in PHP4, there there was no visibility attribute for properties and methods.

0
 
bilgehanyildirimAuthor Commented:
_getParam is shorthand for $this->getRequest()->getParam().

just to be on the safe side, I tried getParam with same result :)
0
 
Richard QuadlingSenior Software DeveloperCommented:
Can you var_dump($this->getRequest()->getParams());

What are you getting?
0
 
bilgehanyildirimAuthor Commented:
actually it doesn't even come to that stage... I put it in the beginning of index.php still didn't run. I think it might be something to do with apache's configuration/
0
 
Richard QuadlingSenior Software DeveloperCommented:
Sorry. I can't help there.
0
 
bilgehanyildirimAuthor Commented:
sorted

service/index/index/?url=http://www.google.co.uk

did just fine.

Thanks for your time anyway.
0
 
Richard QuadlingSenior Software DeveloperCommented:
Argh. Obvious now.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.