千家信息网

apache 伪静态转到nginx

发表于:2024-10-18 作者:千家信息网编辑
千家信息网最后更新 2024年10月18日,1.apache伪静态配置vim httpd.conf#[plain] view plain copy#加载模块LoadModule rewrite_module modules/mod_rewrit
千家信息网最后更新 2024年10月18日apache 伪静态转到nginx

1.apache伪静态配置

vim httpd.conf#[plain] view plain copy#加载模块LoadModule rewrite_module modules/mod_rewrite.so#加载.htaccessAccessFileName .htaccess    Order allow,deny    Deny from all    Satisfy All#设置为All,则读取.htaccess内容[plain] view plain copyOptions FollowSymLinks  AllowOverride All

2.apache伪静态文件

# cat .htaccess RewriteEngine OnRewriteCond %{REQUEST_FILENAME} -s [OR]RewriteCond %{REQUEST_FILENAME} -l [OR]RewriteCond %{REQUEST_FILENAME} -dRewriteRule ^.*$ - [NC,L]RewriteRule ^.*$ index.php [NC,L]

3.配置nginx伪静态

location / {  if (!-f $request_filename){         rewrite ^/(.*)$ /index.php?s=$1 last;         break;  }}


0