我用wamp5本地环境已经正常访问,但是安装到服务器总是404,问了别人好像说是伪静态的问题,
研究了2天,实在不行了,
这个事我的目录结构
index.php代码
define ('site_url','http://www.mydemo.com/demo4/');define('css_url',site_url.'public/home/css/');define('img_url',site_url.'public/home/images/');define('js_url',site_url.'public/home/js/');define('admin_css_url',site_url.'public/admin/css/');define('admin_img_url',site_url.'public/admin/images/');define('admin_js_url',site_url.'public/admin/js/');define('admin_upload_url',site_url.'public/');// 检测php环境if(version_compare(php_version,'5.3.0',' 5.3.0 !');// 开启调试模式 建议开发阶段开启 部署阶段注释或者设为falsedefine('app_debug',true);// 引入thinkphp入口文件require './thinkphp/thinkphp.php';// 亲^_^ 后面不需要任何代码了 就是如此简单
回复讨论(解决方案) 不是php程序的问题,nginx对pathinfo支持不好
配置参考:
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
不是php程序的问题,nginx对pathinfo支持不好
配置参考:
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
这要写在哪里,我用的主机宝,
早知道用windows 好了, nginx 的域名配置文件。
暂时没发现nginx 有啥不好的 哈哈哈 用了 windows 你就知道真的不好了
不是php程序的问题,nginx对pathinfo支持不好
配置参考:
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
这要写在哪里,我用的主机宝,
早知道用windows 好了,
nginx/conf/vhosts/xxx.conf中
或者直接是nginx/conf/nginx.conf
nginx 的域名配置文件。
暂时没发现nginx 有啥不好的 哈哈哈 用了 windows 你就知道真的不好了