Php Smarty.htaccess重写(来自nginx)
我想添加Apache.htaccess规则。这来自旧服务器的nginx:Php Smarty.htaccess重写(来自nginx),php,apache,.htaccess,mod-rewrite,nginx,Php,Apache,.htaccess,Mod Rewrite,Nginx,我想添加Apache.htaccess规则。这来自旧服务器的nginx: location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } location / { if (-f $
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location / {
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
rewrite ^/(.*) /index.php?demand=$1;
}
如何重写这个?我现在得到的只是索引页,其余的文件找不到。我真的希望在这里得到一些帮助,谢谢。这里是从nginx到apache的转换器重写部分应该是:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?demand=$1 [L]
要强制使用https,请在上述规则之前添加以下内容:
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
我怎么能把它和强制使用https结合起来呢?你看到那个问题了吗?