Hi All,

I am trying to implement a directory like url rewriting in php.

My URL goes like this www.xyz.com/Parameter1/Parameter2/1
This request is forwarded to a php script, getParams.php
Parameter1 and Parameter2 in the URL are GET parameters. "1" in the url indicates the page number.

The URL rule that I am writing is
RewriteRule ^(.*)/(.*)/([0-9]*)$ getParams.php?para1=$1&para2=$2&page=$3

The problem is that when the URL is rewritten to getParam.php on the ServerSide and I do an echo on para1
i.e echo para1

First letter of every word is converted to lowercase.
Example if I pass my name in para1 as "Vaibhav Ranglani" and then if I do an echo in getParam.php as

echo $para1;

I'll get the output as
vaibhav ranglani

Here the first letter of every word is converted to lowercase.
Same thing is not happening with para2

I would appreciate any help.

Thanks in Advance

Recommended Answers

All 2 Replies

Seems to me you should be doing these types of rewrites in .htaccess, to send proper server response codes to requester. But if you must do it this way, note that Windows hosting is generally case-insensitive so PAGE.html and page.html are the same. But may not be so on a Linux server.

Otherwise I'm not sure how to help as the problem could be some server configuration or in your PHP code. You could post the relevant code, or ask your host (read the manuals) on whether parameters are automatically stripped of case.

Good luck!

Hi guyinpv,

The issue is resolved. The URL is not causing a problem. Actually I was not capturing para1 and para2 as per the requirements.

Thanks anyways.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.