我的.htaccess
文件:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /index.html [NC,L]
放在根目录(与index.html一起)内。但是,当我刷新时,我收到错误:The requested URL <url> was not found on this server
。
同一个网址正在应用链接中运行。我的.htaccess
文件有问题吗?
答案 0 :(得分:0)
你有一条规则:
RewriteRule ^.*$ - [NC,L]
index.html
以上index.html
规则,因此我猜测^.*$
规则甚至无法处理。更不用说-
规则似乎没有形成,因为L
flag。相反,您似乎正在将所有请求重写为破折号(RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* /index.html [QSA,NC,L]
)。
将文件更改为:
class Variables
{
private:
Variables () {} // to prevent instantiation, which makes no sense
public:
static map<string , int> myMap;
static float numba;
};
float Variables::numba = 0;
map<string , int> Variables::myMap = map<string, int>;
//somehow initialize your static variables