-3

I don't know how to solve this problem.

Please help me to solve this problem.

I was working on localhost. Whenever i operate on localhost/xyz/about.php and localhost/xyz/About.php (about and About) its working. But in godaddy LINUX web server when i change letter to capital one while typing on address bar, like www.xyz.com/about.php to www.xyz.com/About.php, it is not working why?

Is is a case sensitive problem on server? If it is then how can i solve it? thanks.

kazal
  • 13
  • 1
  • 3

2 Answers2

1

godaddy servers are running on a unix machines. this machines have a case sensitive file systems, so About.php and about.php are really different files and one of them is not present on your server. you can use htaccess to rewrite it and redirect but its only a temporary solution

put this .htaccess in your xyz dir

RewriteEngine On
RewriteRule ^(About|aBout|abOut)\.php about.php [L,R=301]
Dima
  • 8,586
  • 4
  • 28
  • 57
  • what to write on htaccess ? – kazal Oct 01 '14 at 17:23
  • its not only about "about or About " it was example i was talking about all url..suppose if a user know url and typed xyz.com/username or xyz.com/Username in both condition it should be working – kazal Oct 01 '14 at 17:46
  • take a look here: https://www.simonholywell.com/post/2012/11/force-lowercase-urls-rewrite-php.html – Dima Oct 01 '14 at 18:03
1

I assume you are running localhost on a Windows OS; its filesystem and naming are case-insensitive.

Linux and other UNIX variants are case-sensitive. The HTTP server will use the OS filesystem to lookup the resource that you request. Unfortunately, that differs by platform.

If you want to replicate your environment, use identical OS on development and production.

Either install Linux in a VM and develop on that, or move to a Windows host provider.

That aside, there are apache modules that will let you achieve case insensitivity on Linux ( How do I make URLs case insensitive in Linux server ), but you should avoid that. Just use the proper case for the URIs and move on. In general, this is why much of the non-Windows web development world uses lowercase for files and URIs. Mixed case naming conventions can be trouble when applied to case sensitive filesystems because of minor variations and differing opinions from developer to developer or company to company.

Community
  • 1
  • 1
codenheim
  • 20,467
  • 1
  • 59
  • 80