.htaccess问题

时间:2011-01-28 09:17:36

标签: .htaccess permissions

我正在开发顶级推车 - 但问题在于,当我尝试设置“启用平面网址生成”时,它说:

  

请注意:编写'.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(.)*

请告诉我这方面的见解并谢谢

1 个答案:

答案 0 :(得分:2)

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]