Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

gnabin01's avatar

Request Query String Parameter not working in Server

I was working with request parameter. In local server request query string parameter is working properly but in Production Server (Centos 7/PHP 7.2.14/Laravel 5.1) it gives different result.

I tested using-------- /api/post?limit=20 and page=1

In local Server if i did $request->all() = {limit:20,page:1} In Server $request->all()=api/post

Why i am getting this error?

0 likes
5 replies
jlrdw's avatar

?limit=20 and page=1

You do not need to pass a query string as a parameter, http takes care of such request.

And it's

?limit=20&page=1

You need to decide to use query string or parameter,

This

site.com/hello/12/world

or

site.com?a=hello&b=12&c=world

If you are confused between QS and params, you need to google the difference.

GamerFac3's avatar

Maybe you have a rewrite rule on your production server that just ignores the query string?

gnabin01's avatar

My .htaccess is like this RewriteEngine On # Removes index.php from ExpressionEngine URLs RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.)$ /index.php?$1 [L] #Authorization header RewriteCond %{HTTP:Authorization} ^(.) RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]

Please or to participate in this conversation.