.htaccess应该有哪些权限?

swvgeqrz  于 2023-06-24  发布在  其他
关注(0)|答案(1)|浏览(159)

我正在使用pinnacle cart -但问题是,当我试图设置“启用平面URL生成”时,它说:
请注意:写入“.htaccess”文件时出错。请检查文件权限。
我不知道应该是哪个许可。我知道它需要有mod_rewrite工作以及。我不熟悉.htaccess和mod_rewrite。
chmod 644 .htacesss根本不起作用。所以我猜如果我不做任何与mod_rewrite,然后.htaccess是不工作?
我做了:chown root .htaccess chown 644 .htaccess
示例:

RewriteEngine   On
RewriteBase     /
RewriteCond     $1 !^(\#(.)*|\?(.)*|\.buildpath(.)*|.svn\/(.)*|admin\.php(.)*|content\/(.)*|download\.php(.)*|images\/(.)*|index\.php(.)*|install\/(.)*|login\.php(.)*|readme\.txt(.)*|robots\.txt(.)*)
RewriteRule     ^(.+)$ index.php?url=$1 [L]

一个问题是,它会导致.html无法联机。所以**我必须添加“*|home\.html(.)*“**吗?
请给予我关于这方面的见解,谢谢

6jygbczu

6jygbczu1#

chown文件(.htaccess)将所有者设置为PHP的用户,然后chmod 755这应该可以做到:)
另外,您还需要:RewriteEngine On见下文

RewriteEngine on
RewriteBase /
RewriteCond $1 !^(#(.)|\?(.)|.buildpath(.)|.svn\/(.)|admin.php(.)|content\/(.)|download.php(.)|images\/(.)|index.php(.)|install\/(.)|login.php(.)|readme.txt(.)|robots.txt(.)*)
RewriteRule ^(.+)$ index.php?url=$1 [L]

相关问题