关于Thinkphp伪静态规则问题,急
答案:2 悬赏:50 手机版
解决时间 2021-02-03 00:25
- 提问者网友:我一贱你就笑
- 2021-02-02 06:57
RewriteRule (?!\/Public)(.*)$ /index\.php/$1 [I] 这样的规则针对的是一级目录。
但是现在我程序在二级目录,程序在we这个文件夹里面,如何修改来实现伪静态呢。
最佳答案
- 五星知识达人网友:鱼忧
- 2021-02-02 08:21
你走弯路了,
config加
'URL_HTML_SUFFIX'=>'shtml'
就行了。
全部回答
- 1楼网友:蕴藏春秋
- 2021-02-02 09:40
关于nginx的伪静态设置(案例)
server {
listen 80;
server_name localhost;
index index.html index.htm index.php;
root /alidata/www/;
location / {
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?s=/$1 last;
}
}
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
# 以下是为了让nginx支持path_info
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param script_filename $document_root$real_script_name;
fastcgi_param script_name $real_script_name;
fastcgi_param path_info $path_info;
fastcgi_connect_timeout 120;
fastcgi_send_timeout 120;
fastcgi_read_timeout 120;
fastcgi_buffers 8 128k;
fastcgi_buffer_size 128k;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
#伪静态规则
access_log /alidata/log/nginx/access/default.log;
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯