前段时间我创建了一个.htaccess
文件并且有效:
RewriteEngine On
RewriteBase /MVC
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
现在我将它安装在另一台机器上,我收到了Apache错误:
/home/zalmoksis/www/public/MVC-demo/.htaccess: RewriteEngine not allowed here
可能有什么问题?
一些相关的Apache配置(如果你需要更多东西,只需这样说):
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/zalmoksis/www/public
<Directory />
Options FollowSymLinks
AllowOverride FileInfo
</Directory>
<Directory /home/zalmoksis/www/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
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/"
<Directory "/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
</Directory>
</VirtualHost>
和此:
Alias /MVC /home/zalmoksis/www/public/MVC-demo
<Directory /home/zalmoksis/www/public/MVC>
Options FollowSymlinks
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
</IfModule>
</Directory>
答案 0 :(得分:0)
只是一个想法。你确定在httpd.conf中没有禁用mod_rewrite.so吗?