“没有”是Lua的基本类型之一吗?(Is 'none' one of basic types in Lua?)
Lua中定义的基本类型如下:
/* ** basic types */ #define LUA_TNONE (-1) #define LUA_TNIL 0 #define LUA_TBOOLEAN 1 #define LUA_TLIGHTUSERDATA 2 #define LUA_TNUMBER 3 #define LUA_TSTRING 4 #define LUA_TTABLE 5 #define LUA_TFUNCTION 6 #define LUA_TUSERDATA 7 #define LUA_TTHREAD 8 #define LUA_NUMTAGS 9
正如Lua Document所说,Lua中只有
8
基本类型。 但是,有10
。 我知道LUA_TLIGHTUSERDATA
和LUA_TUSERDATA
可以表示为userdata
,但是LUA_TNONE
呢? 什么是none
和nil
的差异?The basic types defined in Lua as below :
/* ** basic types */ #define LUA_TNONE (-1) #define LUA_TNIL 0 #define LUA_TBOOLEAN 1 #define LUA_TLIGHTUSERDATA 2 #define LUA_TNUMBER 3 #define LUA_TSTRING 4 #define LUA_TTABLE 5 #define LUA_TFUNCTION 6 #define LUA_TUSERDATA 7 #define LUA_TTHREAD 8 #define LUA_NUMTAGS 9
As Lua Document says that there only
8
basic types in Lua. However, there gets10
. I knowLUA_TLIGHTUSERDATA
andLUA_TUSERDATA
could finnally represented asuserdata
, but what aboutLUA_TNONE
? And what is the differences ofnone
andnil
?
原文:https://stackoverflow.com/questions/38562720
最满意答案
那是因为某些服务器和* nix服务器上的URL区分大小写。
尝试添加
NC flag
,看看是否有帮助。RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f # RewriteRule ^(.*)$ index.php [L] RewriteRule . index.php [NC,L]
https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_nc
或者您也可以尝试使用Multiviews,将其置于顶部。
Options -MultiViews
That's because URL's on some servers and *nix servers are case sensitive.
Try adding the
NC flag
to see if that helps.RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f # RewriteRule ^(.*)$ index.php [L] RewriteRule . index.php [NC,L]
https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_nc
Or you might also try turning of Multiviews, placing this at the top.
Options -MultiViews
相关问答
更多-
使用您给出的示例,这是规则的应用方式: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f # /aio/ is not a file, so this matched RewriteCond %{REQUEST_URI} !(.*)/$ # This DOES NOT match, because you have a trailing slash RewriteRule ^(.*)$ htt ...
-
Apache mod_rewrite匹配部分文件名并返回404(Apache mod_rewrite matches partial filename and returns 404)[2023-12-01]
那是因为某些服务器和* nix服务器上的URL区分大小写。 尝试添加NC flag ,看看是否有帮助。 RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f # RewriteRule ^(.*)$ index.php [L] RewriteRule . index.php [NC,L] https://httpd.apache.org/docs/2.4/rewrite/flags. ... -
1and1 mod_rewrite问题(1and1 mod_rewrite issues)[2023-06-06]
在这里找到答案: 添加以下修复了mod-rewrite: Options -MultiViews http://www.techpopuli.net/news/04/002289.html Found the answer here: Adding the following fixed the mod-rewrite: Options -MultiViews http://www.techpopuli.net/news/04/002289.html -
您可以使用Apache的默认错误处理程序来执行此操作。 应该可以定义一个ErrorDocument,如下所示: ErrorDocument 404 /parseme.php 然后对请求/parseme.php进行语言相关的重定向, /parseme.php所示: RewriteCond %{REQUEST_FILENAME} ^/parseme\.php$ RewriteCond %{HTTP:Accept-Language} ^es [NC] RewriteRule (.+) /esp/error404 ...
-
当您使用上述重写条件请求不存在的文件时,您将遇到无限重定向。 如果你访问http://yoursite.com/i-dont-exist ,第一个条件是评估为true, i-dont-exist.php是一个不存在的文件,所以它会尝试重写为i-dont-exist.php也不存在所以重写模式继续,直到Apache限制递归并给你一个500错误(基本上它不断被重写为i-dont-exist.php.php.php.php.php...php直到你遇到500错误。 您可以通过添加其他检查来解决此问题,以确保在重写 ...
-
在WordPress块之前添加规则,并在匹配时使用[L]停止规则。 这样它就不会流入WordPress规则。
RewriteEngine On RewriteBase / RewriteRule ^v1/?$ /v1.html [L] # BEGIN WordPressRewriteEngine On RewriteBase / Re ... -
Apache 2.4 mod_rewrite(Apache 2.4 mod_rewrite)[2022-03-04]
在您的admin/.htaccess尝试此规则: RewriteEngine On RewriteBase /admin/ RewriteRule ^(\w+)/?$ views/$1/index.html [L] Try this rule in your admin/.htaccess: RewriteEngine On RewriteBase /admin/ RewriteRule ^(\w+)/?$ views/$1/index.html [L] -
使用mod_rewrite为http [关闭]上的所有请求返回404(Using mod_rewrite to return 404 for all requests on http [closed])[2023-10-18]
您不应该使用代码404,因为问题不在于无法找到页面,而是用户正在发出禁止请求。 相反,试试这个: RewriteRule ^ - [F] 然后,您可以使用自定义403错误页面来解释只允许安全请求到此路径。 You shouldn't use code 404 because the problem is not that the page cannot be found, it's that the user is making a forbidden request. Instead, try this ... -
事实证明这与mod_rewrite无关。 URL中的一个目录中有一个空格,我在调用cUrl函数时没有编码。 一旦用%20替换所有空间,一切正常。 主题已结束。 Turns out this has nothing to do with mod_rewrite. One of the directory in the URL had a space in it, that I was not encoding when calling the cUrl function. Once replaced all ...
-
Apache 2.4 mod_rewrite passthrough工作,以404结尾(Apache 2.4 mod_rewrite passthrough working, ending up with 404)[2023-05-26]
正如@deadooshka指出的那样,我的规则从未与没有PHP的请求相匹配,所以我实现了提议的解决方案 RewriteCond %{THE_REQUEST} "\s(\S*)\.php[\?\s]" RewriteRule ^ %1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond "%{REQUEST_FILENAME}.php" -f RewriteRule "!\.php$" "%{REQUEST_URI}.php" [L] 它 ...