Because I'm from Serbia, and the site is in Serbian, so the five files are named Š Đ Č Ć Ž (Unicode). And my keyboard is made for Adriatic region. Not a pain actually, as I said above it worked fine with my previous hosting provider, but when I migrated the impossible happened, although the new one also uses Linux.
The files are fully named literally as Š.php, Đ.php, Č.php, Ć.php and Ž.php and they all use the "switch case" command, and also they worked well until now when I migrated the site. So, the problem is either in the server my site is hosted on, or in my files's names, that's why I asked here for help to resolve it. The Apache's default charset is set on UTF-8, as my hosting provider just told me, and I added the following at the top of my .htaccess file:
IndexIgnore *
IndexOptions +Charset=UTF-8
DefaultLanguage en-US
SetEnv TZ Europe/Belgrade
SetEnv SERVER_ADMIN [email protected]
Options All -Indexes +MultiViews +FollowSymLinks
AddType 'text/html; charset=UTF-8' html
Yes, I thought so too. It works well with all the other letters, except Š, Đ, Č, Ć and Ž... Note that it worked perfectly with my previous hosting provider, but when I switched to a new one, the problem occured. Should I encode the name of file itself, or just add the encoded name in the link that opens it? Or something else?
Okay, I don't know if this section of the site is appropriate for this problem, but this is a burning one. I asked this on StackOverflow, but - according to them - this is not worth answering... The PHP file is in the root directory.
I have a URL:
www.mysite.com/Š.php?open=Šambala
The PHP file:
<?php
switch($_GET["open"]) { case "Šambala": include("/Path/to/the/file/Shambala.html"); break;
}
?>
Now, when I click on the above URL, it returns 404... I don't know is the problem in the unicode file name of "Š.php", or in my .htaccess file, which is listed below. Mod_rewrite is enabled (RewriteEngine On).
The .htaccess file:
DirectoryIndex Index.html Index.htm Index.php Index.php3 Index.phtml Index.php5 Index.shtml Default.html Default.htm Default.php index.html index.htm index.php index.php3 index.phtml index.php5 index.shtml default.html default.htm default.php IndexIgnore * DefaultLanguage en-US SetEnv TZ Europe/Belgrade Options All -Indexes +MultiViews +FollowSymLinks AddType 'text/html; charset=UTF-8' html IndexIgnore *.wmv *.mp4 *.avi *.pdf LimitRequestBody 10240000 AddDefaultCharset UTF-8 ServerSignature Off ErrorDocument 400 /400/ ErrorDocument 403 /403/ ErrorDocument 404 /404/ RewriteEngine On
<IfModule mod_rewrite.c> RewriteCond %{REQUEST_URI} /+[^\.]+$ RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L] </IfModule>
Hello everyone,
Basically, I would need 2 'switch case' scripts for navigation through HTML pages, like this:
1st:
index.php?1
index.php?2 index.php?3... 2nd (this one is with subpages): index.php?1&2 Therefore, an example, with the 2nd one: I have a few books that I want to put online and index.php is the main catalog, then index.php?1 is the first book in the catalog, and the index.php?1&1 is the first book and the first chapter in it... Is this achievable?
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.