VPS侦探论坛

标题: .htaccess 放网站根目录无效,请教下军哥怎么解决 [打印本页]

作者: sky    时间: 2019-4-23 10:44
标题: .htaccess 放网站根目录无效,请教下军哥怎么解决
我弄了个.htaccess 放网站根目录下,可是不起作用,请问怎么解决呢?谢谢


作者: sky    时间: 2019-4-23 11:38
RewriteEngine On

# If requested resource exists as a file or directory, skip next two rules
RewriteCond %{DOCUMENT_ROOT}/$1 -f [OR]
RewriteCond %{DOCUMENT_ROOT}/$1 -d
RewriteRule (.*) - [S=2]
#
# Else rewrite requests for non-existent resources to /index.php
RewriteRule (.*) /index.php?q=$1 [L]

上面是我的htaccess 规则
显示错误
unknown directive "RewriteEngine On" in /home/wwwroot/www.mysite.COM/.htaccess:4
unknown directive "RewriteCond" in /home/wwwroot/www.mysite.COM/.htaccess:4

请教下,谢谢了
作者: licess    时间: 2019-4-23 13:01
apache是apache的,nginx是nginx 两者伪静态是完全不一样不通用
官网 https://lnmp.org 常见问题有说明
作者: sky    时间: 2019-4-23 21:11
licess 发表于 2019-4-23 13:01
apache是apache的,nginx是nginx 两者伪静态是完全不一样不通用
官网 https://lnmp.org 常见问题有说明 ...

谢谢,已解决




欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/) Powered by Discuz! X3.4