当前位置: 技术问答>linux和unix
apache 还是不支持.htaccess~
来源: 互联网 发布时间:2016-11-17
本文导语: 送上我的000-default文件内容 我自认为应该对了啊~ ServerAdmin webmaster@localhost DocumentRoot /home/konakona/www Options Indexes FollowSymLinks MultiViews AllowOverride All Order...
送上我的000-default文件内容
我自认为应该对了啊~
我访问localhost/tpweb/ 没有因为.htaccess的内容,而去访问home.php:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ home.php/$1 [QSA,PT,L]
并且该目录显示403. :em06
konakona@ubuntu:~$ sudo a2enmod rewrite
Module rewrite already enabled
konakona@ubuntu:~$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2 ... waiting [ OK ]
我自认为应该对了啊~
ServerAdmin webmaster@localhost
DocumentRoot /home/konakona/www
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
我访问localhost/tpweb/ 没有因为.htaccess的内容,而去访问home.php:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ home.php/$1 [QSA,PT,L]
并且该目录显示403. :em06
konakona@ubuntu:~$ sudo a2enmod rewrite
Module rewrite already enabled
konakona@ubuntu:~$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2 ... waiting [ OK ]
|
Permission denied: /home/konakona/www/tpweb/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
---------
应该是你的.htaccess文件的权限不对!
chown www-data:www-data /home/konakona/www/tpweb/.htaccess
---------
应该是你的.htaccess文件的权限不对!
chown www-data:www-data /home/konakona/www/tpweb/.htaccess
|
[Thu Mar 24 20:09:25 2011] [crit] [client 127.0.0.1] (13)Permission denied: /home/konakona/www/tpweb/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readabl
这个很明显,不可读
还有lz你的配置文件直接就上
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
不太好把,/下所有的东西都被你这样了,/下默认的策略应该是deny from all
这个很明显,不可读
还有lz你的配置文件直接就上
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
不太好把,/下所有的东西都被你这样了,/下默认的策略应该是deny from all